if re.search("4", opt):
makeMP4=1
recdblist.printutf8(pin)
- if makeMP4==1:
- pout = recpath + "/" + title + ".mp4"
- tv2mp4.ts2mp4(pin, pout, opt)
+ if not re.search("0", opt):
+ if makeMP4==1:
+ pout = recpath + "/" + title + ".mp4"
+ tv2mp4.ts2mp4(pin, pout, opt)
+ else:
+ pout = recpath + "/" + title + ".mkv"
+ tv2mkv.ts2mkv(pin, pout, opt)
+ if re.search("8", opt) or re.search("9", opt):
+ optt=opt
+ optt=optt.replace("8","\\8")
+ optt=optt.replace("9","\\9")
+ pout = recpath + "/" + "m_"+title + ".mp4"
+ tv2mp4.ts2mp4(pin, pout, optt)
else:
- pout = recpath + "/" + title + ".mkv"
- tv2mkv.ts2mkv(pin, pout, opt)
+ optt=opt
+ optt=optt.replace("8","\\8")
+ optt=optt.replace("9","\\9")
+ pout = recpath + "/" + "m_"+title + ".mp4"
+ tv2mp4.ts2mp4(pin, pout, optt)
recdb.del_reckey(typetxting, title, chtxt, btime)
time.sleep(10)
if re.search("E", opt):
size = "FullHD"
if re.search("W",opts):
size = "WVGA"
+ if re.search("\\8", opts):
+ size = "QVGA_BASE"
+ if re.search("\\9", opts):
+ size = "WVGA_BASE"
if re.search("v", opts):
is24fps=1
crf=int(configreader.getenv("animation_crf"))
encvf = encvf + ",scale=720:-2::0:3,expand=720:480"+harddup
x264streamsize=u"720x480"
x264_bitrate="1250"
+ elif size == "QVGA_BASE":
+ encvf = encvf + ",scale=320:-2::0:3,expand=320:240"+harddup
+ x264streamsize=u"320x240"
+ x264_bitrate="300"
+ elif size == "WVGA_BASE":
+ encvf = encvf + ",scale=-2:480::0:3,expand=854:480"+harddup
+ x264streamsize=u"854x480"
+ x264_bitrate="1500"
else:
encvf = encvf + ",scale=-2:720::0:3,expand=1280:720"+harddup
x264streamsize=u"1280x720"
x264preset=u"--preset slow"
elif quality==6:
x264preset=u"--preset slower"
+ if size == "WVGA_BASE" or size == "QVGA_BASE":
+ x264profile=" --level 32 --profile base "
+ else:
+ x264profile=" --level 41 --profile high "
x264crf=u"--crf "+str(crf)
os.environ['LANG']="ja_JP.UTF-8"
random.seed(pin)
streampath=os.path.join(os.path.dirname(pin),str(random.randint(10000, 999999)))
os.system(u"mkfifo "+streampath)
encexe=mencoder+u" \""+pin+u"\" -vfm ffmpeg -quiet -sws 9 "+encvf+u",format=i420 "+fps+" "+ofps+" -oac mp3lame -ovc raw -of rawvideo -o \""+streampath+"\" &"
- encexe=encexe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u" --threads auto --level 41 --profile high "+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize
+ encexe=encexe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u" --threads auto"+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize
encexe=u"nice -n 19 " +encexe
recdblist.printutf8(encexe)
txt=txt+"Cmd : "+encexe+"\n"
s = "-s 720x480 "
x264streamsize=u"720x480"
x264_bitrate="1250"
+ elif size == "QVGA_BASE":
+ s = "-s 320x240 "
+ x264streamsize=u"320x240"
+ x264_bitrate="300"
+ elif size == "WVGA_BASE":
+ s = "-s 854x480 "
+ x264streamsize=u"854x480"
+ x264_bitrate="1500"
else:
s = "-s 1280x720 "
x264streamsize=u"1280x720"
x264preset=u"--preset slow"
elif quality==6:
x264preset=u"--preset slower"
+ if size == "WVGA_BASE" or size == "QVGA_BASE":
+ x264profile=" --level 32 --profile base "
+ else:
+ x264profile=" --level 41 --profile high "
x264crf=u"--crf "+str(crf)
txt=""
os.environ['LANG']="ja_JP.UTF-8"
exe=ffmpeg+u" -y -i \""+pin+"\" -vsync 400 -vcodec rawvideo -pix_fmt yuv420p "+s+fps+"-deinterlace -an -f rawvideo - |"
- exe=exe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u" --threads auto --level 41 --profile high "+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" - "+x264streamsize
+ exe=exe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u" --threads auto "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" - "+x264streamsize
txt=txt+"Cmd : "+exe+"\n"
exe = "nice -n 19 " + exe
txt=txt+"Cmd : "+exe+"\n"