OSDN Git Service

fix ffmpeg option.
[rec10/rec10-git.git] / rec10 / trunk / src / ts2x264.py
index ae914d7..63ef8ff 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
@@ -384,7 +385,7 @@ def getMovieBaseSize(pin):
 def getMovieBaseSize2(pin):##動画開始後すぐに解像度が変更されたときに対処\r
     ffmpeg=configreader.getConfPath("ffmpeg")\r
     os.environ['LANG']="ja_JP.UTF-8"\r
-    exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
+    exe=ffmpeg+u" -ss 5 -fs 1 -t 10 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
     try:\r
         recdblist.addCommandSelfLog(pin, exe)\r
     except Exception, inst:\r
@@ -441,7 +442,7 @@ def getMoviePAR(pin):
 def getMoviePAR2(pin):\r
     ffmpeg=configreader.getConfPath("ffmpeg")\r
     os.environ['LANG']="ja_JP.UTF-8"\r
-    exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
+    exe=ffmpeg+u" -ss 5 -fs 1 -t 10 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
     try:\r
         recdblist.addCommandSelfLog(pin, exe)\r
     except Exception, inst:\r
@@ -504,7 +505,7 @@ def getMovieDAR(pin):
 def getMovieDAR2(pin):\r
     ffmpeg=configreader.getConfPath("ffmpeg")\r
     os.environ['LANG']="ja_JP.UTF-8"\r
-    exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
+    exe=ffmpeg+u" -ss 5 -fs 1 -t 10 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+.*DAR\D+(\d+:\d+)\D+.*\Z")\r
     sizeMaxX=0\r
@@ -577,31 +578,31 @@ def getX264Commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsi
                 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=" --slices 4 --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"--fake-interlaced --ref 6 --pulldown double "+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