OSDN Git Service

implement new x264 option for Blu-ray compat.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sat, 23 Apr 2011 08:29:17 +0000 (08:29 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sat, 23 Apr 2011 08:29:17 +0000 (08:29 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@860 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/tester.py
rec10/trunk/src/ts2x264.py

index 770b5c8..0160459 100644 (file)
@@ -50,4 +50,5 @@ if __name__ == "__main__":
     #recque.searchRecQue(recpath)
     #print chdb.updateLogo()
     #epgdb.updateLogo_bc("bs")
-    ""
\ No newline at end of file
+    print ts2x264.getX264CoreVersion()
+    ""
index 16b6faf..0cda375 100644 (file)
@@ -544,8 +544,10 @@ def getParSize(pin,y):
         tY=-1\r
     return [tX,tY]\r
 def getX264CoreVersion():\r
-    x264=configreader.getConfPath("x264")\r
-    t1=commands.getoutput(x264+" --help|grep core")\r
+    x264=configreader.getConfPath("x264")
+    #print x264\r
+    t1=commands.getoutput(x264+" --help|grep core")
+    #print t1\r
     rT=re.compile(u"x264 core:(\d*)[\d]*.*\Z")\r
     rM=rT.match(t1)\r
     v=-1\r
@@ -567,22 +569,39 @@ 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:\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
-        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
-                else:\r
+    if bluray==1:
+        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=""
+            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
+            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
+                    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=""
+            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
+            elif fps=="30000/1001 --keyint 30" or fps =="30000/1001":\r
+                if x264streamsize=="1280x720":\r
+                    x264bluray=u"--ref 6 "+x264bluray\r
+                if x264streamsize=="1920x1080":\r
+                    if interlaced==0:\r
+                        x264bluray=u"--ref 3 --fake-interlaced --pic-struct "+x264bluray\r
+                    else:\r
+                        x264bluray=u"--ref 3 "+x264bluray\r
     x264_thread="auto"\r
     try:\r
         xtt=configreader.getConfEnv("x264_thread")\r