OSDN Git Service

implement new encode for mobile option.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sat, 3 Apr 2010 01:23:29 +0000 (01:23 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sat, 3 Apr 2010 01:23:29 +0000 (01:23 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@549 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/timerec.py
rec10/trunk/src/ts2x264.py
rec10/trunk/src/tv2mkv.py
rec10/trunk/src/tv2mp4.py

index a31b91e..536ed85 100644 (file)
@@ -609,14 +609,18 @@ def type_encode_que(typetxt,chtxt,title,bt,et,opt):
                     optt=opt
                     optt=optt.replace("8","MW8")
                     optt=optt.replace("9","MW9")
-                    pout = recpath + "/" + "m_"+title + ".mp4"
-                    tv2mp4.ts2mp4(pin, pout, optt)
+                    poutt = recpath + "/" + "m_"+title + ".mp4"
+                    shutil.move(os.path.join(recpath, title+".ts"),os.path.join(recpath, "m_"+title+".ts"))
+                    tv2mp4.ts2mp4(os.path.join(recpath, "m_"+title+".ts"), poutt, optt)
+                    shutil.move(os.path.join(recpath, "m_"+title+".ts"),os.path.join(recpath, title+".ts"))
             else:
                 optt=opt
-                optt=optt.replace("8","\\8")
-                optt=optt.replace("9","\\9")
-                pout = recpath + "/" + "m_"+title + ".mp4"
-                tv2mp4.ts2mp4(pin, pout, optt)
+                optt=optt.replace("8","MW8")
+                optt=optt.replace("9","MW9")
+                poutt = recpath + "/" + "m_"+title + ".mp4"
+                shutil.move(os.path.join(recpath, title+".ts"),os.path.join(recpath, "m_"+title+".ts"))
+                tv2mp4.ts2mp4(os.path.join(recpath, "m_"+title+".ts"), poutt, optt)
+                shutil.move(os.path.join(recpath, "m_"+title+".ts"),os.path.join(recpath, title+".ts"))
             recdb.del_reckey(typetxting, title, chtxt, btime)
             time.sleep(10)
             if re.search("E", opt):
index 7800486..08a64a1 100644 (file)
@@ -131,7 +131,7 @@ def encode(pin,pout,size,is24fps,quality,crf):
     elif quality==6:
         x264preset=u"--preset slower"
     if size == "WVGA_BASE" or size == "QVGA_BASE":
-        x264profile=" --level 32 --profile base "
+        x264profile=" --level 32 --profile baseline "
     else:
         x264profile=" --level 41 --profile high "
     x264crf=u"--crf "+str(crf)
@@ -208,7 +208,7 @@ def encode_ffmpeg(pin,pout,size,is24fps,quality,crf):
     elif quality==6:
         x264preset=u"--preset slower"
     if size == "WVGA_BASE" or size == "QVGA_BASE":
-        x264profile=" --level 32 --profile base "
+        x264profile=" --level 32 --profile baseline "
     else:
         x264profile=" --level 41 --profile high "
     x264crf=u"--crf "+str(crf)
index 01911d0..9000c30 100644 (file)
@@ -22,6 +22,9 @@ def ts2mkv(pin, pout, opt):
         time.sleep(10)
         if os.path.isfile(tpraw) and os.path.getsize(tpraw)>10*1000:
             raw2mkv(tpraw, tpmkv, opt)
+        time.sleep(10)
+        if os.path.exists(tpraw):
+            os.remove(tpraw)
 def raw2mkv(pin,pout,opt):#x264
     dir=os.path.split(pout)[0]
     title=os.path.split(pout)[1]
index b3b5b24..f9f0fa1 100644 (file)
@@ -26,6 +26,9 @@ def ts2mp4(pin, pout, opt):
         time.sleep(10)\r
         if os.path.isfile(tpraw) and os.path.getsize(tpraw)>10*1000:\r
             raw2mp4(tpraw, tpmp4, opt)\r
+        time.sleep(10)\r
+        if os.path.exists(tpraw):\r
+            os.remove(tpraw)\r
 def raw2mp4(pin,pout,opt):\r
     dir=os.path.split(pout)[0]\r
     title=os.path.split(pout)[1]\r