OSDN Git Service

fix some miss.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 5 Mar 2010 22:38:33 +0000 (22:38 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 5 Mar 2010 22:38:33 +0000 (22:38 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@455 4e526526-5e11-4fc0-8910-f8fd03428081

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

index 33980d9..edf1083 100644 (file)
@@ -87,7 +87,7 @@ def auto_check(path):
                     add.append([recdblist.REC_AUTO_SUGGEST_DECODE,title,nchtxt])
                 elif proc=="ts":
                     add.append([recdblist.REC_AUTO_SUGGEST_ENCODE,title,nchtxt])
-                elif proc =="avi":
+                elif proc =="264":
                     add.append([recdblist.REC_AUTO_SUGGEST_AVI2FP,title,nchtxt])
                 #elif proc =="mp4":
                 #    add.append([recdblist.REC_AUTO_SUGGEST_AP2FP,title,nchtxt])
@@ -122,9 +122,9 @@ def check_process(path,title):
             return "mp4"
         else:
             return "mp4making"
-    elif os.path.exists(os.path.join(path,title+".avi")):
-        if int(time.time()-os.path.getmtime(os.path.join(path,title+".avi")))>300:
-            return "avi"
+    elif os.path.exists(os.path.join(path,title+".264")):
+        if int(time.time()-os.path.getmtime(os.path.join(path,title+".264")))>300:
+            return "264"
         else:
             return "encoding"
     elif os.path.exists(os.path.join(path,title+".ts.log")):
index 1ecb4ad..bbf814d 100644 (file)
@@ -54,5 +54,5 @@ cs = 0
 make_mp4 = 1
 #エンコードの重さの設定 大きければ大きいほど(1-6)速度は遅くなるが同じ画質でもサイズが小さくなる。
 x264_preset=4
-crf=20
-animation_crf=18
+crf=22
+animation_crf=20
index 1ef4cee..15b8021 100644 (file)
@@ -173,10 +173,22 @@ def task():
                 if pid > 0:#親プロセスの場合
                     ""
                 else:
+                    makeMP4=0
+                    try:
+                        if configreader.getenv("make_mp4")==1:
+                            makeMP4=1
+                    except:
+                        ""
+                    if re.search("m", opt):
+                        makeMP4=0
+                    if re.search("4", opt):
+                        makeMP4=1
                     recdb.del_reckey(recdblist.REC_AVI_TO_MKV, title, chtxt, btime)
                     recdb.rec_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime, etime, opt)
-                    #tv2mp4.avi2mp4(os.path.join(recpath,title+".avi"),os.path.join(recpath,title+".mkv"),opt)
-                    tv2mkv.avi2mkv(os.path.join(recpath,title+".avi"),os.path.join(recpath,title+".mkv"),opt)
+                    if makeMP4==1:
+                        tv2mp4.raw2mp4(os.path.join(recpath,title+".264"),os.path.join(recpath,title+".mp4"),opt)
+                    else:
+                        tv2mkv.raw2mkv(os.path.join(recpath,title+".264"),os.path.join(recpath,title+".mkv"),opt)
                     recdb.del_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime)
                     sys.exit()
         elif task["type"] == recdblist.REC_AVI_TO_MP4:
@@ -185,9 +197,23 @@ def task():
                 if pid > 0:#親プロセスの場合
                     ""
                 else:
+                    makeMP4=0
+                    try:
+                        if configreader.getenv("make_mp4")==1:
+                            makeMP4=1
+                    except:
+                        ""
+                    if re.search("m", opt):
+                        makeMP4=0
+                    if re.search("4", opt):
+                        makeMP4=1
                     recdb.del_reckey(recdblist.REC_AVI_TO_MP4, title, chtxt, btime)
                     recdb.rec_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime, etime, opt)
-                    tv2mp4.avi2mp4(os.path.join(recpath,title+".avi"),os.path.join(recpath,title+".mp4"),opt)
+                    if makeMP4==1:
+                        tv2mp4.ts2mp4(pin, pout, opt)
+                        tv2mp4.raw2mp4(os.path.join(recpath,title+".264"),os.path.join(recpath,title+".mp4"),opt)
+                    else:
+                        tv2mkv.raw2mkv(os.path.join(recpath,title+".264"),os.path.join(recpath,title+".mkv"),opt)
                     recdb.del_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime)
                     sys.exit()
         elif task["type"] == recdblist.REC_MKV_TO_MP4:
index a53fcec..9e8a3a0 100644 (file)
@@ -114,7 +114,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=u"mencoder \""+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+" --level 41 --profile high "+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize
+    encexe=encexe+u" nice -n 19 x264 "+x264crf+" --vbv-bufsize 30000 --vbv-maxrate 15000 --level 41 --profile high "+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize
     encexe=u"nice -n 19 " +encexe
     recdblist.printutf8(encexe)
     txt=txt+"Cmd : "+encexe+"\n"
@@ -168,7 +168,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+" --level 41 --profile high "+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" - "+x264streamsize
+    exe=exe+u" nice -n 19 x264 "+x264crf+" --vbv-bufsize 30000 --vbv-maxrate 10000 --level 41 --profile high "+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" - "+x264streamsize
     txt=txt+"Cmd : "+exe+"\n"
     exe = "nice -n 19 " + exe
     txt=txt+"Cmd : "+exe+"\n"