OSDN Git Service

add x264 thread option.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 7 May 2010 04:30:05 +0000 (04:30 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 7 May 2010 04:30:05 +0000 (04:30 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@589 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/rec10.conf
rec10/trunk/src/ts2x264.py

index bb46394..099025d 100644 (file)
@@ -59,5 +59,6 @@ make_mp4 = 1
 x264_preset=4
 crf=24
 animation_crf=18
+x264_thread = 0
 x264_addline =
 remove_ts = 0
index 08a64a1..f2bda75 100644 (file)
@@ -82,6 +82,14 @@ def encode(pin,pout,size,is24fps,quality,crf):
     x264preset=""
     x264tune=""
     x264_bitrate="5000"
+    x264_thread="auto"
+    try:
+        xtt=configreader.getenv("x264_thread")
+        xtt=int(xtt)
+        if xtt>0:
+            x264_thread=str(xtt)
+    except:
+        x264_thread="auto"
     x264_addline=configreader.getenv("x264_addline")
     if is24fps==1:
         ofps="-ofps 24000/1001"
@@ -141,7 +149,7 @@ def encode(pin,pout,size,is24fps,quality,crf):
     streampath=os.path.join(os.path.dirname(pin),str(random.randint(10000, 999999)))
     os.system(u"mkfifo "+streampath)
     encexe=mencoder+u" \""+pin+u"\" -vfm ffmpeg -quiet -sws 9 "+encvf+u",format=i420 "+fps+" "+ofps+" -oac mp3lame -ovc raw -of rawvideo -o \""+streampath+"\" &"
-    encexe=encexe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u"  --threads auto"+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize
+    encexe=encexe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u"  --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize
     encexe=u"nice -n 19 " +encexe
     recdblist.printutf8(encexe)
     txt=txt+"Cmd : "+encexe+"\n"
@@ -166,6 +174,14 @@ def encode_ffmpeg(pin,pout,size,is24fps,quality,crf):
     x264preset=""
     x264tune=""
     x264_bitrate="2500"
+    x264_thread="auto"
+    try:
+        xtt=configreader.getenv("x264_thread")
+        xtt=int(xtt)
+        if xtt>0:
+            x264_thread=str(xtt)
+    except:
+        x264_thread="auto"
     x264_addline=configreader.getenv("x264_addline")
     if size == "HD":
         s = "-s 1280x720 "
@@ -215,7 +231,7 @@ def encode_ffmpeg(pin,pout,size,is24fps,quality,crf):
     txt=""
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -y -i \""+pin+"\" -vsync 400 -vcodec rawvideo -pix_fmt yuv420p "+s+fps+"-deinterlace -an -f rawvideo - |"
-    exe=exe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u" --threads auto "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" - "+x264streamsize
+    exe=exe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u" --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" - "+x264streamsize
     txt=txt+"Cmd : "+exe+"\n"
     exe = "nice -n 19 " + exe
     txt=txt+"Cmd : "+exe+"\n"