3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009 Yukikaze
9 def ts2xvid(pin,pout,opts):#sizeは"HD"か"SD"
11 pinで指定されたファイルをpoutにx264でエンコードして書き出す
13 pout = pout.encode('utf-8')
14 pin = pin.encode('utf-8')
17 status.setEncoding(status.getEncoding()+1)
19 if re.search("a",opts):
23 if re.search("2",opts):
25 if re.search("Q",opts):
27 if re.search("F",opts):
29 if re.search("H",opts):
31 if re.search("S",opts):
34 encvf="-vf pullup,softskip,pp=l5,"
38 encvf=encvf+"scale=720:480,harddup"
39 bitrate="bitrate="+tv2avi.Bitrate_SD
41 encvf=encvf+"scale=1280:720,harddup"
42 bitrate="bitrate="+tv2avi.Bitrate_HD
44 encvf=encvf+"scale=1920:1080,harddup"
45 bitrate="bitrate="+tv2avi.Bitrate_FHD
47 encvf=encvf+"scale=400:240,harddup"
48 bitrate="bitrate="+tv2avi.Bitrate_WQVGA
50 encvf=encvf+"scale=1280:720,harddup"
51 bitrate="bitrate="+tv2avi.Bitrate_HD
54 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"
55 pas2exe="mencoder \'"+pin+"\' -ovc xvid "+encvf+" -xvidencopts "+bitrate+":threads=2:pass=2 -passlogfile "+pin+".log "+"-oac mp3lame -lameopts cbr:br=128 -o \'"+pout+"\'"
56 pas1exe="/usr/bin/nice -n 19 "+pas1exe
57 pas2exe="/usr/bin/nice -n 19 "+pas2exe
64 pas1exe="mencoder \'"+pin+"\' -ovc xvid "+encvf+" -xvidencopts "+bitrate+":threads=2 -oac mp3lame -lameopts cbr:br=128 -o \'"+pout+"\'"
66 status.setEncoding(status.getEncoding()-1)