else:
return ""
def execMove(title,temppath,recpath):
- srcpath=os.path.join(temppath,title+".mp4")
+ srcpath=os.path.join(temppath,title+".mkv")
#desttitle=destName(title, temppath, recpath)
sf=searchFolder(title, recpath)
if sf!="":
- destpath=os.path.join(sf,destNameMP4(title, temppath, sf)+".mp4")
+ destpath=os.path.join(sf,destNameMKV(title, temppath, sf)+".mkv")
#os.path.join(sf,desttitle+".mkv")
#recdblist.printutf8(srcpath)
#recdblist.printutf8(destpath)
recdblist.printutf8("moving now..")
recdblist.printutf8(srcpath+" : "+destpath)
+ print srcpath
shutil.move(srcpath, destpath)
#shutil.copy(srcpath, destpath)
delpath=[os.path.join(temppath,title+".ts")]
delpath.append(os.path.join(temppath,title+".avi"))
+ delpath.append(os.path.join(temppath,title+".120.avi"))
+ delpath.append(os.path.join(temppath,title+".timecode.txt"))
+ delpath.append(os.path.join(temppath,title+".aac"))
delpath.append(os.path.join(temppath,title+".ts.b25"))
delpath.append(os.path.join(temppath,title+".ts.tsmix"))
delpath.append(os.path.join(temppath,title+".ts.log"))
#print opts.ltitle
ltitle=unicode(opts.ltitle,'utf-8')
sf=searchFolder(ltitle, recordedpath)
- recdblist.printutf8(os.path.join(sf, destNameMP4(ltitle,recpath,sf)+".mp4"))
+ recdblist.printutf8(os.path.join(sf, destNameMKV(ltitle,recpath,sf)+".mkv"))
#print os.path.join(sf, destNameMP4(ltitle,recpath,sf)+".mp4")
elif opts.auto:
- sa=search_mp4(recpath, recordedpath)
+ sa=search_mkv(recpath, recordedpath)
for t in sa:
recdblist.printutf8(u"自動推測実行中")
sf=searchFolder(t,recordedpath)
if sf!="":
recdblist.printutf8(u"移動先")
- recdblist.printutf8(t+" : "+os.path.join(sf, destNameMP4(t, recpath,sf)+".mp4"))
+ recdblist.printutf8(t+" : "+os.path.join(sf, destNameMKV(t, recpath,sf)+".mkv"))
recdblist.printutf8(u"実行中")
execMove(t, recpath, recordedpath)
else:
recdblist.printutf8(t+" can't find matching folder.")
elif opts.list:
- sa=search_mp4(recpath, recordedpath)
+ sa=search_mkv(recpath, recordedpath)
for t in sa:
sf=searchFolder(t,recordedpath)
if sf!="":
- recdblist.printutf8(t+u" : "+os.path.join(sf, destNameMP4(t, recpath,sf)+".mp4"))
+ recdblist.printutf8(t+u" : "+os.path.join(sf, destNameMKV(t, recpath,sf)+".mkv"))
elif opts.etitle!="":
etitle=unicode(opts.etitle,'utf-8')
execMove(etitle,recpath, recordedpath)
def encode(pin,pout,size,isvfr,is2pass):
encvf=""
txt=""
- encvf="-vf yadif=0,hqdn3d=2:1:2"
+ encvf="-vf yadif=0,pp=mb"
harddup=",harddup"
ofps="-ofps 30000/1001"
bm=1
crf=""
if isvfr==1:
ofps="-ofps 120000/1001"
- encvf="-vf pullup,softskip,yadif=0,hqdn3d=2:1:2"
+ encvf="-vf pullup,softskip,pp=mb"
bm=4
x264enc1=":me=hex"
x264enc2=":frameref=3:subq=7:partitions=all:8x8dct:me=umh:bframes=3:weight_b"
harddup=""
if size == "HD":
- encvf = encvf + ",scale=1280:720"+harddup
+ encvf = encvf + ",scale=1280:720:::4"+harddup
bitrate = "bitrate=" + str(tv2avi.Bitrate_HD*bm)
- crf="crf=18"
+ crf="crf=20"
elif size == "SD":
- encvf = encvf + ",scale=720:480"+harddup
+ encvf = encvf + ",scale=720:480:::4"+harddup
bitrate = "bitrate=" + str(tv2avi.Bitrate_SD*bm)
- crf="crf=18"
+ crf="crf=20"
elif size == "FHD":
- encvf = encvf + ",scale=1920:1080"+harddup
+ encvf = encvf + ",scale=1920:1080:::4"+harddup
bitrate = "bitrate=" + str(tv2avi.Bitrate_FHD*bm)
- crf="crf=20"
+ crf="crf=22"
elif size == "Short":
encvf = encvf +harddup
bitrate = "bitrate=" + str(tv2avi.Bitrate_Short*bm)
- crf="crf=18"
+ crf="crf=20"
elif size == "LowHD":
- encvf = encvf + ",scale=1280:720"+harddup
+ encvf = encvf + ",scale=1280:720:::4"+harddup
bitrate = "bitrate=" + str(tv2avi.Bitrate_LowHD*bm)
- crf="crf=20"
+ crf="crf=22"
else:
- encvf = encvf + ",scale=1280:720"+harddup
+ encvf = encvf + ",scale=1280:720:::4"+harddup
bitrate = "bitrate=" + str(tv2avi.Bitrate_HD*bm)
- crf="crf=20"
+ crf="crf=22"
if is2pass == 1:
- pas1exe = "mencoder \'" + pin + "\' -quiet -ovc x264 " + encvf + " "+ofps+" -x264encopts " + bitrate +x264enc1+ ":threads=auto:pass=1:turbo=2 -passlogfile \'" + pin + ".log\' " + "-oac faac -o /dev/null"
- pas2exe = "mencoder \'" + pin + "\' -quiet -ovc x264 " + encvf + " "+ofps+" -x264encopts " + bitrate +x264enc2+ ":threads=auto:pass=2 -passlogfile \'" + pin + ".log\' " + "-oac faac -o \'" + pout + "\'"
+ pas1exe = "mencoder \'" + pin + "\' -quiet -sws 9 -ovc x264 " + encvf + " "+ofps+" -x264encopts " + bitrate +x264enc1+ ":threads=auto:pass=1:turbo=2 -passlogfile \'" + pin + ".log\' " + "-oac faac -o /dev/null"
+ pas2exe = "mencoder \'" + pin + "\' -quiet -sws 9 -ovc x264 " + encvf + " "+ofps+" -x264encopts " + bitrate +x264enc2+ ":threads=auto:pass=2 -passlogfile \'" + pin + ".log\' " + "-oac faac -o \'" + pout + "\'"
pas1exe = "nice -n 19 " + pas1exe
pas2exe = "nice -n 19 " + pas2exe
recdblist.printutf8(pas1exe)
time.sleep(5)
txt=txt+unicode(commands.getoutput(pas2exe.encode('utf-8')),'utf-8')
else:
- pas1exe = "mencoder \'" + pin + "\' -quiet -ovc x264 " + encvf + " "+ofps+" -x264encopts " + crf +x264enc2+":threads=auto -oac faac -o \'" + pout + "\'"
+ pas1exe = "mencoder \'" + pin + "\' -quiet -sws 9 -ovc x264 " + encvf + " "+ofps+" -x264encopts " + bitrate +x264enc2+":threads=auto -oac faac -o \'" + pout + "\'"
pas1exe = "nice -n 19 " + pas1exe
recdblist.printutf8(pas1exe)
txt=txt+unicode(commands.getoutput(pas1exe.encode('utf-8')),'utf-8')