3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009 Yukikaze
10 def ts2xvid(pin,pout,opts):#sizeは"HD"か"SD"
12 pinで指定されたファイルをpoutにx264でエンコードして書き出す
14 pout = pout.encode('utf-8')
15 pin = pin.encode('utf-8')
18 status.setEncoding(status.getEncoding()+1)
20 if re.search("a",opts):
24 if re.search("2",opts):
26 if re.search("Q",opts):
28 if re.search("F",opts):
30 if re.search("H",opts):
32 if re.search("S",opts):
35 encvf="-vf pullup,softskip,pp=l5,"
39 encvf=encvf+"scale=720:480,harddup"
40 bitrate="bitrate="+tv2avi.Bitrate_SD
42 encvf=encvf+"scale=1280:720,harddup"
43 bitrate="bitrate="+tv2avi.Bitrate_HD
45 encvf=encvf+"scale=1920:1080,harddup"
46 bitrate="bitrate="+tv2avi.Bitrate_FHD
48 encvf=encvf+"scale=400:240,harddup"
49 bitrate="bitrate="+tv2avi.Bitrate_WQVGA
51 encvf=encvf+"scale=1280:720,harddup"
52 bitrate="bitrate="+tv2avi.Bitrate_HD
55 pas1exe="mencoder \'"+pin+"\' -ovc xvid "+encvf+" -xvidencopts "+bitrate+":threads=2:pass=1:turbo -passlogfile "+pin+".log "+"-oac mp3lame -lameopts cbr:br=128 -o /dev/null"
56 pas2exe="mencoder \'"+pin+"\' -ovc xvid "+encvf+" -xvidencopts "+bitrate+":threads=2:pass=2 -passlogfile "+pin+".log "+"-oac mp3lame -lameopts cbr:br=128 -o \'"+pout+"\'"
57 pas1exe="/usr/bin/nice -n 19 "+pas1exe
58 pas2exe="/usr/bin/nice -n 19 "+pas2exe
65 pas1exe="mencoder \'"+pin+"\' -ovc xvid "+encvf+" -xvidencopts "+bitrate+":threads=2 -oac mp3lame -lameopts cbr:br=128 -o \'"+pout+"\'"
67 status.setEncoding(status.getEncoding()-1)