dir=os.path.split(pout)[0]
title=os.path.split(pout)[1]
title=os.path.splitext(title)[0]
- isvfr=0
isdualaac=0
ispentaaudio=0
- if re.search("v", opt):
- isvfr=1
if re.search("d",opt):
- isvfr=0
isdualaac=1
elif re.search("5",opt):
ispentaaudio=1
exe = configreader.getpath("mkvmerge")
txt=""
os.environ['LANG']="ja_JP.UTF-8"
- if isvfr==1:
- wineexe=configreader.getpath("wine")
- cap2ass=configreader.getpath("Caption2Ass")
- pints=pin.replace(".avi",".ts")
- pincap=pin.replace(".avi",".srt")
- pinaac=pin.replace(".avi",".aac")
- 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 -d 0 -A -S '"+pin+"' --sync 0:-100 --forced-track 0:no -a 0 -D -S '"+pinaac+"' --track-order 0:0,1:0"
- #e3s=exe +" -o '"+pout+u"' --forced-track 0:no -d 0 -A -S '"+pin+"' --sync 0:-100 --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"
- e3=exe +" -o '"+pout+u"' --forced-track 0:no -d 0 -a 1 -S '"+pin+"' --sync 0:0 --track-order 0:0,0:1"
- e3s=exe +" -o '"+pout+u"' --forced-track 0:no -d 0 -a 1 -S '"+pin+"' --sync 0:0 --forced-track 0:no -s 0 -D -A '"+pincap+"' --track-order 0:0,0:1,1:0"
- txt=txt+execcomd(e0)
- #txt=txt+execcomd(e1)
- txt=txt+execcomd(e2)
- if os.path.exists(pincap) and (os.path.getsize(pincap)>1000):
- txt=txt+execcomd(e3s)
- else:
- txt=txt+execcomd(e3)
- elif isdualaac==1:
+ if isdualaac==1:
wineexe=configreader.getpath("wine")
pincap=pin.replace(".avi",".srt")
cap2ass=configreader.getpath("Caption2Ass")
e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" \"Z:\\"+pincap+"\""
e1=exe +" -o \""+pout+u"\" --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 1 -D -S \""+paac1+"\" --forced-track 0:no -a 1 -D -S \""+paac2+"\" --track-order 0:0,1:1,2:1"
e1s=exe +" -o \""+pout+u"\" --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 1 -D -S \""+paac1+"\" --forced-track 0:no -a 1 -D -S \""+paac2+"\" --forced-track 0:no -s 0 -D -A \""+pincap+"\" --track-order 0:0,1:1,2:1,3:0"
- txt=txt+execcomd(e0)
+ if os.path.isfile(cap2ass):
+ txt=txt+execcomd(e0)
if os.path.exists(pincap) and (os.path.getsize(pincap)>1000):
txt=txt+execcomd(e1s)
else:
e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" \"Z:\\"+pincap+"\""
e1=exe +" -o \""+pout+u"\" --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 1 -D -S \""+paac1+"\" --forced-track 0:no -a 1 -D -S \""+paac2+"\" --track-order 0:0,1:1,2:1"
e1s=exe +" -o \""+pout+u"\" --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 1 -D -S \""+paac1+"\" --forced-track 0:no -a 1 -D -S \""+paac2+"\" --forced-track 0:no -s 0 -D -A \""+pincap+"\" --track-order 0:0,1:1,2:1,3:0"
- txt=txt+execcomd(e0)
+ if os.path.isfile(cap2ass):
+ txt=txt+execcomd(e0)
if os.path.exists(pincap) and (os.path.getsize(pincap)>1000):
txt=txt+execcomd(e1s)
else:
e1="ffmpeg -i \""+pints+"\" -vn -f aac -acodec copy \""+pinaac+"\""
e2=exe +" -o \""+pout+u"\" --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --forced-track 0:no -a 0 -D -S \""+pinaac+"\" --track-order 0:0,1:0"
e2s=exe +" -o \""+pout+u"\" --forced-track 0:no -d 0 -A -S \""+pin+"\" --sync 0:0 --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"
- txt=txt+execcomd(e0)
+ if os.path.isfile(cap2ass):
+ txt=txt+execcomd(e0)
txt=txt+execcomd(e1)
if os.path.exists(pincap) and (os.path.getsize(pincap)>1000):
txt=txt+execcomd(e2s)