View Full Version : Double-frame rate deinterlace with ffmpeg


bigmick
25th May 2008, 05:46
Hi Everyone

Hope I'm posting this in the right place...
Have been trying to soak in as much info on the net as possible the last couple weeks, but I really need some expert advice.

Here's my problem: The MediaPC software I use is SageTV and it supports auto-compressing of recordings, which is very nice, but I can't get a decent quality encode. The SageTVTranscoder seems to be just a version of ffmpeg, as here is the first few lines of output if I execute it from the command-line:

FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --extra-libs=-lwsock32 --enable-libfaad --enable-x264 --enable-memalign-hack --enable-gpl --enable-xvid --enable-libfaac --enable-lib
mp3lame --disable-debug --enable-amr_wb --enable-amr_nb --enable-liba52 --disable-demuxer=ea
libavutil version: 49.4.0
libavcodec version: 51.40.2
libavformat version: 51.11.0
built on Feb 26 2008 10:01:53, gcc: 3.4.2 (mingw-special)
usage: ffmpeg [[infile options] -i infile]... {[outfile options] outfile}...
Hyper fast Audio and Video encoder

Main options:
-L show license
-h show help
-version show version
etc
etc


All my recordings are SD digital TV (mpeg2) PAL 576i 16:9. I want to convert to an mpg4 format (xvid, h.264 or whatever) and preserve the original resolution and aspect ratio. Around 2500kbps video and 192kbps audio seems to give me a quality I'm happy with.

A lot of what I record is sport (fast motion stuff) so after a lot of reading and testing I've come to the conclusion that I should either deinterlace it using a technique that will double the framerate or encode it interlaced and worry about deinterlacing it on playback. Unfortunately I can't figure out how to do either with ffmpeg. Can anyone help me with the options???

The standard Sage profile for HQ XVid uses the following options, but this doesn't double the framerate when it deinterlaces and I'm not happy with the resulting clip:

f=avi;MCompressionDetails=-vtag xvid -deinterlace;[bf=vid;f=mpeg4;br=2000000;w=720;h=576;fps=25;][bf=aud;]

(Obviously sage controls some of the options that are sent through to ffmpeg and eg I think it does 2 passes etc).


These mencoder options give me pretty much what I want if that's any help:

mencoder.exe -vf crop=704:560:10:10,tfields=4,scale=1024:576 -ovc xvid -xvidencopts pass=1:bitrate=2500:vhq=1:max_bframes=2:turbo=1:threads=2 -nosound -noodml -fps 50 -ofps 50 -o NUL "sourcefile"

mencoder.exe" -vf crop=704:560:10:10,tfields=4,scale=1024:576 -ovc xvid -xvidencopts pass=2:bitrate=2500:vhq=1:max_bframes=2:threads=2 -oac mp3lame -lameopts cbr:br=192:mode=1 -noodml -fps 50 -ofps 50 -o "outputfile" "sourcefile"

Any help would be really appreciated