if isvfr==1:
wineexe=configreader.getpath("wine")
cfr2tc=configreader.getpath("cfr2tc")
+ cap2ass=configreader.getpath("Caption2Ass")
pin120=pin.replace(".avi",".120.avi")
pints=pin.replace(".avi",".ts")
pintimecode=pin.replace(".avi",".timecode.txt")
+ pincap=pin.replace(".avi",".srt")
pinaac=pin.replace(".avi",".aac")
- exes.append("ffmpeg -i '"+pints+"' -vn -f aac -acodec copy '"+pinaac+"'")
- exes.append(wineexe+u" "+cfr2tc+u" '"+"Z:\\"+pin+"' '"+"Z:\\"+pin120+u"' '"+"Z:\\"+pintimecode+u"' 2")
- exes.append(exe +" -o '"+pout+u"' --forced-track 0:no --timecodes '0:"+pintimecode+"' -d 0 -A -S '"+pin120+"' --sync 0:-225 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0")
+ e0="ffmpeg -i '"+pints+"' -vn -f aac -acodec copy '"+pinaac+"'"
+ e1=wineexe+u" "+cfr2tc+u" '"+"Z:\\"+pin+"' '"+"Z:\\"+pin120+u"' '"+"Z:\\"+pintimecode+u"' 2"
+ e2=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" Z:\\"+pincap+"\""
+ e3=exe +" -o '"+pout+u"' --forced-track 0:no --timecodes '0:"+pintimecode+"' -d 0 -A -S '"+pin120+"' --sync 0:-225 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0"
+ e3s=exe +" -o '"+pout+u"' --forced-track 0:no --timecodes '0:"+pintimecode+"' -d 0 -A -S '"+pin120+"' --sync 0:-225 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --forced-track 0:no -s 0 -D -A '"+pincap+"' --track-order 0:0,1:0,2:0"
#exes.append(exe +" -o '"+pout+u"' --forced-track 0:no --timecodes '0:"+pintimecode+"' -d 0 -A -S '"+pin120+"' --sync 0:0 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0")
#exes.append(doexe = exe + u" -o '" + pout + u"' --cues 0:all --forced-track 0:no --default-duration 0:120000/1001fps -d 0 -A -S '" + pin + u"' --sync 0:0 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0")
- for e in exes:
- ex= "nice -n 17 "+e
- recdblist.printutf8(e)
- txt=txt+e+"\n"
- cmdt=""
- try:
- cmdt=unicode(commands.getoutput(ex.encode('utf-8')),'utf-8')
- except:
- ""
- txt=txt+cmdt+"\n"
+ execcomd(e0)
+ execcomd(e1)
+ execcomd(e2)
+ if os.path.exists(pincap):
+ execcomd(e3s)
+ else:
+ execcomd(e3)
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")
- e="mencoder -noodml -forceidx -oac copy -ovc copy -o \'"+ptmp+"\'"+" \'"+pin+"\'"
- ex="nice -n 17 "+e
+ e1="mencoder -noodml -forceidx -oac copy -ovc copy -o \'"+ptmp+"\'"+" \'"+pin+"\'"
e2=wineexe+u" "+cfr2tc+u" '"+"Z:\\"+ptmp+"' '"+"Z:\\"+pin120+u"' '"+"Z:\\"+pintimecode+u"' 2"
- ex2="nice -n 17 "+e2
- e3=exe +" -o '"+pout+u"' --forced-track 0:no --timecodes '0:"+pintimecode+"' -d 0 -A -S '"+pin120+"' --sync 0:-225 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0"
+ e3=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" Z:\\"+pincap+"\""
+ e4=exe +" -o '"+pout+u"' --forced-track 0:no --timecodes '0:"+pintimecode+"' -d 0 -A -S '"+pin120+"' --sync 0:-225 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0"
+ e4s=exe +" -o '"+pout+u"' --forced-track 0:no --timecodes '0:"+pintimecode+"' -d 0 -A -S '"+pin120+"' --sync 0:-225 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --forced-track 0:no -s 0 -D -A '"+pincap+"' --track-order 0:0,1:0,2:0"
recdblist.printutf8(e)
txt=txt+e+"\n"
- try:
- cmdt=unicode(commands.getoutput(ex.encode('utf-8')),'utf-8')
- cmdt=cmdt+unicode(commands.getoutput(ex2.encode('utf-8')),'utf-8')
- cmdt=cmdt+unicode(commands.getoutput(e3.encode('utf-8')),'utf-8')
- os.remove(ptmp)
- except:
- ""
+ cmdt=execcomd(e1)
+ cmdt=cmdt+execcomd(e2)
+ cmdt=cmdt+execcomd(e3)
+ if os.path.exists(pincap):
+ execcomd(e4s)
+ else:
+ execcomd(e4)
+ os.remove(ptmp)
txt=txt+cmdt+"\n"
else:
- exes.append(exe + u" -o '" + pout + u"' --forced-track 0:no --forced-track 1:no -a 1 -d 0 -S '" + pin + u"' --track-order 0:0,0:1")
- for e in exes:
- ex= "nice -n 17 "+e
- recdblist.printutf8(e)
- txt=txt+e+"\n"
- cmdt=""
- try:
- cmdt=unicode(commands.getoutput(ex.encode('utf-8')),'utf-8')
- except:
- ""
- txt=txt+cmdt+"\n"
+ pincap=pin.replace(".avi",".srt")
+ cap2ass=configreader.getpath("Caption2Ass")
+ pints=pin.replace(".avi",".ts")
+ e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" Z:\\"+pincap+"\""
+ e1=exe + u" -o '" + pout + u"' --forced-track 0:no --forced-track 1:no -a 1 -d 0 -S '" + pin + u"' --track-order 0:0,0:1"
+ e1s=exe + u" -o '" + pout + u"' --forced-track 0:no --forced-track 1:no -a 1 -d 0 -S '" + pin + u"' --forced-track 0:no -s 0 -A -D '"+pincap+"' --track-order 0:0,0:1,1:0"
+ txt=txt+execcomd(e0)
+ if os.path.exists(pincap):
+ txt=txt+execcomd(e1s)
+ else:
+ txt=txt+execcomd(e1)
logo=pout.replace(".mkv",".log")
"""if (isvfr==1 and (not os.path.exists(pin.replace(".avi",".120.avi"))) and (not os.path.exists(pout))):
exes=[]
txt = "\n####mkvmerge-log####\n"+txt
f=open(logo,'a')
f.write(txt.encode('utf-8'))
- f.close()
\ No newline at end of file
+ f.close()
+def execcomd(cmd):
+ txt=""
+ cmdt=u"nice -n 17 "+cmd
+ try:
+ txt=u"Cmd : "+cmd+"\n"
+ txt2=commands.getoutput(cmdt.encode('utf-8'))
+ txt=txt+unicode(txt2,"utf-8")+"\n"
+ except:
+ ""
+ return txt
\ No newline at end of file
wineexe=configreader.getpath("wine")\r
cfr2tc=configreader.getpath("cfr2tc")\r
dtsedit=configreader.getpath("DtsEdit")\r
+ caption2ass=configreader.getpath("Caption2Ass")\r
pin120=os.path.join(dir,etitle+u".120.avi")\r
pints=os.path.join(dir,title+u".ts")\r
pmp4=os.path.join(dir,etitle+u".tmp.mp4")\r
pintimecode=os.path.join(dir,etitle+u".timecode.txt")\r
pinaac=os.path.join(dir,etitle+u".aac")\r
+ pincat=os.path.join(dir,etitle+u".srt")\r
evfr0="ffmpeg -i '"+pints+"' -vn -f aac -acodec copy '"+pinaac+"'"\r
evfr1=wineexe+u" "+cfr2tc+u" '"+"Z:\\"+pin+"' '"+"Z:\\"+pin120+u"' 'Z:\\"+pintimecode+u"' 2"\r
evfr2=exe+u" -aviraw video \'"+pin120+u"\'"\r
exe3=wineexe+u" "+dtsedit+u" -tc \'Z:\\"+timecodepath+u"\' \'Z:\\"+tmpmp4+u"\' -o \'Z:\\"+pout+u"\'"\r
logo=pin.replace(".avi",".log")\r
os.environ['LANG']="ja_JP.UTF-8"\r
- txt= exe0+"\n"+exe1+"\n"+exe2+"\n"+exe3+"\n"\r
- try:\r
- txt = txt+unicode(commands.getoutput(exe0.encode('utf-8')),'utf-8')\r
- except:\r
- ""\r
- try:\r
- txt = txt+unicode(commands.getoutput(exe1.encode('utf-8')),'utf-8')\r
- except:\r
- ""\r
- try:\r
- txt = txt+unicode(commands.getoutput(exe2.encode('utf-8')),'utf-8')\r
- except:\r
- ""\r
- try:\r
- os.system(exe3.encode('utf-8'))\r
- except:\r
- ""\r
+ txt=""\r
+ execcomd(exe0)\r
+ execcomd(exe1)\r
+ execcomd(exe2)\r
+ execcomd(exe3)\r
txt = "\n####MKV2MP4-log####\n"+txt\r
f=open(logo,'a')\r
f.write(txt.encode('utf-8'))\r
os.remove(timecodepath)\r
if os.path.exists(tmpmp4):\r
os.remove(tmpmp4)\r
+def execcomd(cmd):\r
+ txt=""\r
+ try:\r
+ txt=u"Cmd : "+cmd+"\n"\r
+ txt2=commands.getoutput(cmd.encode('utf-8'))\r
+ txt=txt+unicode(txt2,"utf-8")+"\n"\r
+ except:\r
+ ""\r
+ return txt\r