OSDN Git Service

fix mkv2mp4.
[rec10/rec10-git.git] / rec10 / trunk / src / tv2mp4.py
index 3eb39ca..f1c4326 100644 (file)
@@ -54,8 +54,7 @@ def avi2mp4(pin,pout,opt):
         evfr.append(exe+u" -aviraw video \'"+pin120+u"\'")
         videotpath=os.path.join(dir,etitle+u".120_video.264")
         evfr.append(exe+u" -fps 29.970030 -add \'"+videotpath+"\' -add \'"+pinaac+"\' -new \'"+pmp4+"\'")
-        evfr.append(wineexe+u" "+dtsedit+u" -tc \'Z:\\"+pintimecode+u"\' \'Z:\\"+pmp4+"\' -o \'Z:\\"+pmp42+"\'")
-        evfr.append(exe+u" -add \'"+pinaac+"\' \'"+pmp42+"\'")
+        evfr.append(wineexe+u" "+dtsedit+u" -tc \'Z:\\"+pintimecode+u"\' \'Z:\\"+pmp4+"\' -o \'Z:\\"+pout+"\'")
         exes=evfr
         for e in exes:
             recdblist.printutf8(e)
@@ -64,10 +63,6 @@ def avi2mp4(pin,pout,opt):
                 txt=txt+unicode(commands.getoutput(e.encode('utf-8')),'utf-8')
             except:
                 ""
-        try:
-            shutil.move(pmp42,pout)
-        except:
-            ""
         if (not os.path.exists(pin.replace(".avi",".120.avi"))and (not os.path.exists(pout))):
             txt=txt+"CFR2TC error. maybe avi file is over 1GB.(ODML error would have happend.)"
             ptmp=pin.replace(".avi",".noodml.avi")
@@ -77,12 +72,10 @@ def avi2mp4(pin,pout,opt):
             ex2="nice -n 17 "+e2
             e3=exe+u" -aviraw video \'"+pin120+u"\'"
             ex3="nice -n 17 "+e3
-            e4=exe+u" -fps 29.97 -add \'"+videotpath+"\' -new \'"+pmp4+"\'"
+            e4=exe+u" -fps 29.97 -add \'"+videotpath+"\' -add \'"+pinaac+"\' -new \'"+pmp4+"\'"
             ex4="nice -n 17 "+e4
-            e5=wineexe+u" "+dtsedit+u" -tc \'Z:\\"+pintimecode+u"\' \'Z:\\"+pmp4+"\' -o \'Z:\\"+pmp42+"\'"
+            e5=wineexe+u" "+dtsedit+u" -tc \'Z:\\"+pintimecode+u"\' \'Z:\\"+pmp4+"\' -o \'Z:\\"+pout+"\'"
             ex5="nice -n 17 "+e5
-            e6=exe+u" -add \'"+pinaac+"\' \'"+pmp42+"\'"
-            ex6="nice -n 17 "+e6
             recdblist.printutf8(e)
             txt=txt+e+"\n"
             try:
@@ -106,17 +99,9 @@ def avi2mp4(pin,pout,opt):
             except:
                 ""
             try:
-                cmdt=unicode(commands.getoutput(ex6.encode('utf-8')),'utf-8')
-            except:
-                ""
-            try:
                 os.remove(ptmp)
             except:
                 ""
-            try:
-                shutil.move(pmp42,pout)
-            except:
-                ""
             txt=txt+cmdt+"\n"
     else:
         try:
@@ -181,9 +166,8 @@ def mkv2mp4(pin,pout):
     tmpmp42=os.path.join(dir,etitle+u".mp4")
     exe0=exeb+u" tracks \'"+pin+u"\' 1:\'"+videopath+u"\' 2:\'"+audiopath+u"\'"
     exe1=exeb+u" timecodes_v2 \'"+pin+"\' 1:\'"+timecodepath+"\'"
-    exe2=exe+u" -fps 29.970030 -add \'"+videopath+u"\' -new \'"+tmpmp4+u"\'"
-    exe3=wineexe+u" "+dtsedit+u" -tc \'Z:\\"+timecodepath+u"\' \'Z:\\"+tmpmp4+u"\' -o \'Z:\\"+tmpmp42+u"\'"
-    exe4=exe+u" -add \'"+audiopath+u"\' \'"+tmpmp42+u"\'"
+    exe2=exe+u" -fps 29.970030 -add \'"+videopath+u"\' -add \'"+audiopath+u"\' -new \'"+tmpmp4+u"\'"
+    exe3=wineexe+u" "+dtsedit+u" -tc \'Z:\\"+timecodepath+u"\' \'Z:\\"+tmpmp4+u"\' -o \'Z:\\"+pout+u"\'"
     logo=pin.replace(".avi",".log")
     os.environ['LANG']="ja_JP.UTF-8"
     txt= exe0+"\n"+exe1+"\n"+exe2+"\n"+exe3+"\n"
@@ -203,11 +187,6 @@ def mkv2mp4(pin,pout):
         os.system(exe3.encode('utf-8'))
     except:
         ""
-    try:
-        txt = txt+unicode(commands.getoutput(exe4.encode('utf-8')),'utf-8')
-    except:
-        ""
-    shutil.move(tmpmp42,pout)
     txt = "\n####MKV2MP4-log####\n"+txt
     f=open(logo,'a')
     f.write(txt.encode('utf-8'))