title=os.path.splitext(title)[0]\r
tpraw=os.path.join(dir, title+".264")\r
tpmp4=os.path.join(dir, title+".mp4")\r
- tv2avi.ts2raw(pin, tpraw, opt)\r
- time.sleep(10)\r
- if os.path.isfile(tpraw) and os.path.getsize(tpraw)>10*1000:\r
- raw2mp4(tpraw, tpmp4, opt)\r
+ if os.path.isfile(pin) and os.path.getsize(pin)>10*1000:\r
+ tv2avi.ts2raw(pin, tpraw, opt)\r
+ 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
if isdualaac==1:\r
wineexe=configreader.getpath("wine")\r
pincap=pin.replace(".264",".srt")\r
- cap2ass=configreader.getpath("Caption2Ass")\r
+ try:\r
+ cap2ass=configreader.getpath("caption2ass")\r
+ except:\r
+ cap2ass=""\r
pints=pin.replace(".264",".ts")\r
paac1=pin.replace(".264","_1.aac")\r
paac2=pin.replace(".264","_2.aac")\r
elif ispentaaudio==1:\r
wineexe=configreader.getpath("wine")\r
pincap=pin.replace(".264",".srt")\r
- cap2ass=configreader.getpath("Caption2Ass")\r
+ try:\r
+ cap2ass=configreader.getpath("caption2ass")\r
+ except:\r
+ cap2ass=""\r
pints=pin.replace(".264",".ts")\r
paac1=pin.replace(".264","_1.aac")\r
paac2=pin.replace(".264","_2.aac")\r
else:\r
wineexe=configreader.getpath("wine")\r
pincap=pin.replace(".264",".srt")\r
- cap2ass=configreader.getpath("Caption2Ass")\r
+ try:\r
+ cap2ass=configreader.getpath("caption2ass")\r
+ except:\r
+ cap2ass=""\r
pints=pin.replace(".264",".ts")\r
pinaac=pin.replace(".264",".aac")\r
e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" \"Z:\\"+pincap+"\""\r
recdblist.addlog(pout, txt, "mp4box-log")\r
if status.getSettings_auto_del_tmp()==1:\r
if os.path.exists(pout):\r
- if os.path.getsize(pout)>100*1000*1000:\r
- deltitle(dir,title)\r
+ if re.search(opt,"MW8") or re.search(opt,"MW9"):\r
+ if os.path.getsize(pout)>50*1000*1000:\r
+ deltitle(dir,title)\r
+ elif re.search(opt,"8") or re.search(opt,"9"):\r
+ ""\r
+ else:\r
+ if os.path.getsize(pout)>100*1000*1000:\r
+ deltitle(dir,title)\r
def mkv2mp4(pin,pout):\r
exeb = configreader.getpath(u"mkvextract")\r
- exe = configreader.getpath(u"MP4Box")\r
- dtsedit=configreader.getpath("DtsEdit")\r
+ exe = configreader.getpath(u"mp4Box")\r
+ #dtsedit=configreader.getpath("DtsEdit")\r
wineexe=configreader.getpath("wine")\r
dir=os.path.split(pin)[0]\r
title=os.path.split(pin)[1]\r
recdblist.addlog(pin, txt, "MKV2MP4-log")\r
txt = "\n####MKV2MP4-log####\n"+txt\r
time.sleep(10)\r
- if os.path.exists(pout):\r
- if os.path.exists(audiopath):\r
- os.remove(audiopath)\r
- if os.path.exists(videopath):\r
- os.remove(videopath)\r
- if os.path.exists(timecodepath):\r
- os.remove(timecodepath)\r
- if os.path.exists(tmpmp4):\r
- os.remove(tmpmp4)\r
+ if status.getSettings_auto_del_tmp()==1:\r
+ if os.path.exists(pout):\r
+ if os.path.getsize(pout)>100*1000*1000:\r
+ deltitle(dir,title)\r
def execmp4box(pin,pout,cmd):\r
title=os.path.splitext(os.path.split(pin)[1])[0]\r
ptin=os.path.join(os.path.dirname(pin),base64.b16encode(title.encode('utf-8'))+".264")\r