OSDN Git Service

fix ch scan.
[rec10/rec10-git.git] / rec10 / trunk / src / ts2x264.py
index ef46832..4e5b0f8 100644 (file)
@@ -6,6 +6,7 @@ import commands
 import configreader\r
 import os\r
 import os.path\r
+import sys\r
 import re\r
 import random\r
 import time\r
@@ -189,7 +190,7 @@ def encodeMencoderSar(pin,pout,size,is24fps,quality,crf,deinterlace=1,uselavf=0,
         encvf=encvf+harddup\r
         x264streamsize=str(tsize[0])+u"x"+str(tsize[1])\r
         if usebluray==1:\r
-            encvf = encvf + ",scale=-2:1080::0:3,expand=1920:1080"+harddup\r
+            encvf = u"-sws 9 "+encvf + ",scale=-2:1080::0:3,expand=1920:1080"+harddup\r
             x264streamsize=u"1920x1080"\r
     if tsize[0] <= 0 or tsize[1] <= 0:\r
         encvf="-sws 9 -vf yadif=0,pp=l5"\r
@@ -571,37 +572,37 @@ def getX264Commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsi
         x264interlaced="--tff --nal-hrd vbr"\r
     if bluray==1:\r
         if getX264CoreVersion()<115:\r
-            x264bluray="--demuxer raw --weightp 1 --nal-hrd vbr --bframes 3 --b-pyramid none --open-gop bluray --slices 4 --aud --colorprim bt709 --transfer bt709 "\r
+            x264bluray=" --weightp 1 --nal-hrd vbr --bframes 3 --b-pyramid none --open-gop bluray --slices 4 --aud --colorprim bt709 --transfer bt709 "\r
             x264_addline=""\r
             if fps=="24000/1001 --keyint 24" or fps =="24000/1001":\r
                 if x264streamsize=="1280x720":\r
                     x264bluray=u"--ref 6 "+x264bluray\r
                 if x264streamsize=="1920x1080":\r
-                    x264bluray=u"--ref 3 "+x264bluray\r
+                    x264bluray=u"--ref 4 "+x264bluray\r
             elif fps=="30000/1001 --keyint 30" or fps =="30000/1001":\r
                 if x264streamsize=="1280x720":\r
                     x264bluray=u"--ref 6 --pulldown double "+x264bluray\r
                 if x264streamsize=="1920x1080":\r
                     if interlaced==0:\r
-                        x264bluray=u"--ref 3 --fake-interlaced --pic-struct "+x264bluray\r
+                        x264bluray=u"--ref 4 --fake-interlaced --pic-struct "+x264bluray\r
                     else:\r
-                        x264bluray=u"--ref 3 "+x264bluray\r
+                        x264bluray=u"--ref 4 "+x264bluray\r
         elif getX264CoreVersion()>=115:\r
-            x264bluray="--demuxer raw --bluray-compat --open-gop --nal-hrd vbr --bframes 3 --b-pyramid none --aud --colorprim bt709 --transfer bt709 "\r
+            x264bluray=" --slices 4 --bluray-compat --nal-hrd vbr --bframes 3 --b-pyramid strict --aud --colorprim bt709 --transfer bt709 "\r
             x264_addline=""\r
             if fps=="24000/1001 --keyint 24" or fps =="24000/1001":\r
                 if x264streamsize=="1280x720":\r
                     x264bluray=u"--ref 6 "+x264bluray\r
                 if x264streamsize=="1920x1080":\r
-                    x264bluray=u"--ref 3 "+x264bluray\r
+                    x264bluray=u"--ref 4 "+x264bluray\r
             elif fps=="30000/1001 --keyint 30" or fps =="30000/1001":\r
                 if x264streamsize=="1280x720":\r
-                    x264bluray=u"--ref 6 "+x264bluray\r
+                    x264bluray=u"--ref 6 --pulldown double "+x264bluray\r
                 if x264streamsize=="1920x1080":\r
                     if interlaced==0:\r
-                        x264bluray=u"--ref 3 --fake-interlaced --pic-struct "+x264bluray\r
+                        x264bluray=u"--ref 4 --fake-interlaced --pic-struct "+x264bluray\r
                     else:\r
-                        x264bluray=u"--ref 3 "+x264bluray\r
+                        x264bluray=u"--ref 4 "+x264bluray\r
     x264_thread="auto"\r
     try:\r
         xtt=configreader.getConfEnv("x264_thread")\r
@@ -613,7 +614,7 @@ def getX264Commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsi
     x264_addline=configreader.getConfEnv("x264_addline")\r
     if getX264CoreVersion()>103:\r
         x264res=u"--input-res "+x264streamsize\r
-        exe=u"nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264bluray+u" "+x264interlaced+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" "+x264res+" -o \""+pout+"\" "+pin\r
+        exe=u"nice -n 19 "+x264+" --demuxer raw --vbv-maxrate 30000 --vbv-bufsize 25000 "+x264_sar+" "+x264crf+u" "+x264bluray+u" "+x264interlaced+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" "+x264res+" -o \""+pout+"\" "+pin\r
     else:\r
-        exe=u"nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264bluray+u" "+x264interlaced+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+pin+" "+x264streamsize\r
+        exe=u"nice -n 19 "+x264+" --demuxer raw --vbv-maxrate 30000 --vbv-bufsize 25000 "+x264_sar+" "+x264crf+u" "+x264bluray+u" "+x264interlaced+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+pin+" "+x264streamsize\r
     return exe\r