3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009 Yukikaze
11 def ts2x264(pin,pout,opts):#sizeは"HD"か"SD"
12 pout = pout.encode('utf-8')
13 pin = pin.encode('utf-8')
15 pinで指定されたファイルをpoutにx264でエンコードして書き出す
18 status.setEncoding(status.getEncoding()+1)
23 if re.search("a",opts):
27 if re.search("2",opts):
29 if re.search("Q",opts):
31 if re.search("F",opts):
33 if re.search("H",opts):
35 if re.search("S",opts):
38 encvf="-vf pullup,softskip,pp=l5,"
42 encvf=encvf+"scale=720:480,harddup"
43 bitrate="bitrate="+tv2avi.Bitrate_SD
45 encvf=encvf+"scale=1280:720,harddup"
46 bitrate="bitrate="+tv2avi.Bitrate_HD
48 encvf=encvf+"scale=1920:1080,harddup"
49 bitrate="bitrate="+tv2avi.Bitrate_FHD
51 encvf=encvf+"scale=400:240,harddup"
52 bitrate="bitrate="+tv2avi.Bitrate_WQVGA
54 encvf=encvf+"scale=1280:720,harddup"
55 bitrate="bitrate="+tv2avi.Bitrate_HD
58 pas1exe="mencoder \'"+pin+"\' -quiet -ovc x264 "+encvf+" -x264encopts "+bitrate+":threads=auto:pass=1:turbo=2 -passlogfile \'"+pin+".log\' "+"-oac mp3lame -lameopts cbr:br=128 -o /dev/null"
59 pas2exe="mencoder \'"+pin+"\' -quiet -ovc x264 "+encvf+" -x264encopts "+bitrate+":threads=auto:pass=2 -passlogfile \'"+pin+".log\' "+"-oac mp3lame -lameopts cbr:br=128 -o \'"+pout+"\'"
60 pas1exe="/usr/bin/nice -n 19 "+pas1exe
61 pas2exe="/usr/bin/nice -n 19 "+pas2exe
68 pas1exe="mencoder \'"+pin+"\' -quiet -ovc x264 "+encvf+" -x264encopts "+bitrate+":threads=auto -oac mp3lame -lameopts cbr:br=128 -o \'"+pout+"\'"
69 pas1exe="/usr/bin/nice -n 19 "+pas1exe
71 status.setEncoding(status.getEncoding()-1)