From bd55915341c441223ba053b49e5cdcdaac9c995a Mon Sep 17 00:00:00 2001 From: gn64_jp Date: Sun, 18 Jul 2010 00:06:57 +0000 Subject: [PATCH] implement interlaced encode option(alpha ver). git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@648 4e526526-5e11-4fc0-8910-f8fd03428081 --- rec10/trunk/src/ts2x264.py | 21 +++++++++++---------- rec10/trunk/src/tv2mp4.py | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/rec10/trunk/src/ts2x264.py b/rec10/trunk/src/ts2x264.py index c131ea9..503fd0d 100644 --- a/rec10/trunk/src/ts2x264.py +++ b/rec10/trunk/src/ts2x264.py @@ -80,7 +80,7 @@ def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1): x264=configreader.getpath("x264") encvf="" txt="" - encvf="-vf yadif=0,pp=l5" + encvf="-sws 9 -vf yadif=0,pp=l5" harddup=",hqdn3d=2:1:2,unsharp=l3x3:0.75:c3x3:0.75,harddup" ofps="-ofps 30000/1001" fps="-fps 30000/1001" @@ -105,15 +105,8 @@ def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1): fps="-fps 30000/1001" x264fps="--fps 24000/1001" x264tune="--tune animation" - encvf="-vf pullup,softskip" + encvf="-sws 9 -vf pullup,softskip" harddup=",pp=l5,unsharp=l3x3:0.75:c3x3:0.75,hqdn3d=2:1:2,harddup" - if deinterlace==0: - ofps="-ofps 60000/1001" - fps="-fps 60000/1001" - x264fps="--fps 60000/1001" - x264tune="--tune animation --tff --nal-hrd vbr" - encvf="-vf hqdn3d=2:1:2" - harddup=",harddup" if size == "HD": tsize=get_par_size(pin,720) encvf = encvf + ",scale=-3:720::0:3"+harddup @@ -144,6 +137,14 @@ def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1): encvf = encvf + ",scale=-3:720::0:3"+harddup x264streamsize=str(tsize[0])+u"x720" x264_bitrate="2500" + if deinterlace==0: + ofps="-ofps 30000/1001" + fps="-fps 30000/1001" + x264fps="--fps 30000/1001" + x264tune="--tune animation --tff --nal-hrd vbr" + encvf="-vf hqdn3d=2:1:2" + harddup=",harddup" + encvf=encvf+harddup if quality==1: x264preset=u"--preset ultrafast" elif quality==2: @@ -166,7 +167,7 @@ def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1): random.jumpahead(10) 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=mencoder+u" \""+pin+u"\" -vfm ffmpeg -quiet "+encvf+u",format=i420 "+fps+" "+ofps+" -oac mp3lame -ovc raw -of rawvideo -o \""+streampath+"\" &" encexe=encexe+u" nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264_addline+u" --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize encexe=u"nice -n 19 " +encexe recdblist.printutf8(encexe) diff --git a/rec10/trunk/src/tv2mp4.py b/rec10/trunk/src/tv2mp4.py index feb8ce1..821a057 100644 --- a/rec10/trunk/src/tv2mp4.py +++ b/rec10/trunk/src/tv2mp4.py @@ -41,7 +41,7 @@ def raw2mp4(pin,pout,opt): if re.search("a",opt): duration="-fps 23.976023 " elif re.search("I",opt): - duration="-fps 59.940060 " + duration="-fps 29.970030 " elif re.search("v",opt): duration="-fps 23.976023 " if re.search("d",opt): -- 2.11.0