From: gn64_jp Date: Sat, 3 Oct 2009 12:01:17 +0000 (+0000) Subject: fix resizing options. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7d91bcf3f7e89e9b5559a539da3c7fb65dfd73a3;p=rec10%2Frec10-git.git fix resizing options. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@169 4e526526-5e11-4fc0-8910-f8fd03428081 --- diff --git a/rec10/trunk/src/timerec.py b/rec10/trunk/src/timerec.py index efca12a..da39e42 100644 --- a/rec10/trunk/src/timerec.py +++ b/rec10/trunk/src/timerec.py @@ -53,8 +53,8 @@ def task(): rec10d.rec10db.update_status_by_bctype_chdata(bctype, "0") epgdb.updatebc(bctype) update = chdb.update() + i = i + 1 #rec10d.rec10db.update_by_bctype_chdata(bctype) - i = i + 1 if i > 0: break sys.exit() diff --git a/rec10/trunk/src/ts2x264.py b/rec10/trunk/src/ts2x264.py index d99395b..3e2ad41 100644 --- a/rec10/trunk/src/ts2x264.py +++ b/rec10/trunk/src/ts2x264.py @@ -15,58 +15,59 @@ def ts2x264(pin, pout, opts):#sizeは"HD"か"SD" pinで指定されたファイルをpoutにx264でエンコードして書き出す """ isAnime = 0 - size = "SD" - txt="" if re.search("a", opts): isAnime = 1 - #print "isAnime" dualpass = 0 + resize=0 + size="Tall" if re.search("2", opts): dualpass = 1 - if re.search("Q", opts): - size = "WQVGA" - if re.search("F", opts): - size = "FHD" - if re.search("T", opts): - size = "THD" if re.search("H", opts): size = "HD" if re.search("S", opts): size = "SD" + if re.search("F", opts): + size = "FHD" + if re.search("L", opts): + size = "Short" + if re.search("G", opts): + size = "LowHD" + encode(pin, pout,size,isAnime,dualpass) +def encode(pin,pout,size,isAnime,is2pass): + encvf="" + txt="" if isAnime == 1: encvf = "-vf pullup,softskip,pp=l5," else: encvf = "-vf pp=l5," - if size == "SD": - encvf = encvf + "scale=720:480,harddup" - bitrate = "bitrate=" + tv2avi.Bitrate_SD - elif size == "HD": + if size == "HD": encvf = encvf + "scale=1280:720,harddup" bitrate = "bitrate=" + tv2avi.Bitrate_HD + elif size == "SD": + encvf = encvf + "scale=720:480,harddup" + bitrate = "bitrate=" + tv2avi.Bitrate_SD elif size == "FHD": encvf = encvf + "scale=1920:1080,harddup" bitrate = "bitrate=" + tv2avi.Bitrate_FHD - elif size == "THD": - encvf = encvf + "scale=1440:1080,harddup" - bitrate = "bitrate=" + tv2avi.Bitrate_THD - elif size == "WQVGA": - encvf = encvf + "scale=400:240,harddup" - bitrate = "bitrate=" + tv2avi.Bitrate_WQVGA + elif size == "Short": + encvf = encvf + "harddup" + bitrate = "bitrate=" + tv2avi.Bitrate_Short + elif size == "LowHD": + encvf = encvf + "scale=1280:720,harddup" + bitrate = "bitrate=" + tv2avi.Bitrate_LowHD else: encvf = encvf + "scale=1280:720,harddup" bitrate = "bitrate=" + tv2avi.Bitrate_HD - if dualpass == 1: + if is2pass == 1: 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" pas2exe = "mencoder \'" + pin + "\' -quiet -ovc x264 " + encvf + " -x264encopts " + bitrate + ":threads=auto:pass=2 -passlogfile \'" + pin + ".log\' " + "-oac mp3lame -lameopts cbr:br=128 -o \'" + pout + "\'" pas1exe = "nice -n 19 " + pas1exe pas2exe = "nice -n 19 " + pas2exe print pas1exe txt=txt+commands.getoutput(pas1exe) - #os.system(pas1exe) print pas2exe time.sleep(5) txt=txt+commands.getoutput(pas2exe) - #os.system(pas2exe) else: pas1exe = "mencoder \'" + pin + "\' -quiet -ovc x264 " + encvf + " -x264encopts " + bitrate + ":threads=auto -oac mp3lame -lameopts cbr:br=128 -o \'" + pout + "\'" pas1exe = "nice -n 19 " + pas1exe @@ -86,7 +87,6 @@ def ts2x264(pin, pout, opts):#sizeは"HD"か"SD" if s>0: s=s+len("\n") stxt=stxt[s:] - txt="\n####mencoder-log####\n"+stxt + txt="\n####mencoder-log_"+size+"####\n"+stxt f.write(txt) - f.close() - \ No newline at end of file + f.close() \ No newline at end of file diff --git a/rec10/trunk/src/tv2avi.py b/rec10/trunk/src/tv2avi.py index d0f7b7d..e882d80 100644 --- a/rec10/trunk/src/tv2avi.py +++ b/rec10/trunk/src/tv2avi.py @@ -15,16 +15,19 @@ import status import ts2x264 import ts2xvid import tv2ts +global Bitrate_SD global Bitrate_HD global Bitrate_FHD -global Bitrate_SD -global Bitrate_WQVGA -global Bitrate_THD -Bitrate_HD = "2500" -Bitrate_FHD = "3750" +global Bitrate_Short +global Bitrate_LowHD Bitrate_SD = "1250" -Bitrate_THD = "3750" -Bitrate_WQVGA = "200" +Bitrate_HD = "3750" +Bitrate_LowHD = "2500" +Bitrate_FHD = "5000" +Bitrate_Short = "1250" +#Bitrate_Tall = "2500" +#Bitrate_Grande = "3750" +#Bitrate_Venti = "5000" def timetv2b25(pout, chtxt, btime, etime, opt): """ poutはタイトル diff --git a/rec10/trunk/src/tv2ts.py b/rec10/trunk/src/tv2ts.py index 6c5e360..8af8b14 100644 --- a/rec10/trunk/src/tv2ts.py +++ b/rec10/trunk/src/tv2ts.py @@ -57,7 +57,6 @@ def b252ts(pout, ch, csch): os.remove(path + "/" + t + ext) except: "" - def tv2b25ts(pout, ch, time): exe = configreader.getpath('recpt1') if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上 @@ -65,6 +64,7 @@ def tv2b25ts(pout, ch, time): else: status.changeTERecording(1) doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\'' + print doexe txt="####recpt1-log####\n" txt = txt + commands.getoutput(doexe) logo=pout.replace(".ts.b25",".log")