OSDN Git Service

add demuxer option to x264 commandline.
[rec10/rec10-git.git] / rec10 / trunk / src / ts2x264.py
index 0cda375..ef46832 100644 (file)
@@ -37,11 +37,11 @@ def ts2x264(pin, pout, opts):#sizeは"HD"か"SD"
         size = "WVGA"\r
     if re.search("MW1",opts):\r
         size = "QVGA_BASE"\r
-        crf=crf+4
+        crf=crf+4\r
         sar=0\r
     if re.search("MW2", opts):\r
         size = "WVGA_BASE"\r
-        crf=crf+2
+        crf=crf+2\r
         sar=0\r
     if re.search("v", opts):\r
         is24fps=1\r
@@ -384,7 +384,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"
+    exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
     try:\r
         recdblist.addCommandSelfLog(pin, exe)\r
     except Exception, inst:\r
@@ -441,7 +441,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"
+    exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
     try:\r
         recdblist.addCommandSelfLog(pin, exe)\r
     except Exception, inst:\r
@@ -544,9 +544,9 @@ def getParSize(pin,y):
         tY=-1\r
     return [tX,tY]\r
 def getX264CoreVersion():\r
-    x264=configreader.getConfPath("x264")
+    x264=configreader.getConfPath("x264")\r
     #print x264\r
-    t1=commands.getoutput(x264+" --help|grep core")
+    t1=commands.getoutput(x264+" --help|grep core")\r
     #print t1\r
     rT=re.compile(u"x264 core:(\d*)[\d]*.*\Z")\r
     rM=rT.match(t1)\r
@@ -569,10 +569,10 @@ def getX264Commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsi
         x264crf=u"--crf "+str(crf)\r
     if interlaced==1:\r
         x264interlaced="--tff --nal-hrd vbr"\r
-    if bluray==1:
+    if bluray==1:\r
         if getX264CoreVersion()<115:\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=""
+            x264bluray="--demuxer raw --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
@@ -585,10 +585,10 @@ def getX264Commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsi
                     if interlaced==0:\r
                         x264bluray=u"--ref 3 --fake-interlaced --pic-struct "+x264bluray\r
                     else:\r
-                        x264bluray=u"--ref 3 "+x264bluray
-        elif getX264CoreVersion()>=115:
-            x264bluray="--bluray-compat --open-gop --nal-hrd vbr --bframes 3 --b-pyramid none --aud --colorprim bt709 --transfer bt709 "
-            x264_addline=""
+                        x264bluray=u"--ref 3 "+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
+            x264_addline=""\r
             if fps=="24000/1001 --keyint 24" or fps =="24000/1001":\r
                 if x264streamsize=="1280x720":\r
                     x264bluray=u"--ref 6 "+x264bluray\r