PDA

View Full Version : HELP: FFMPEG Command Line


Top_Cat
1st March 2007, 12:45
I'm trying to encode some PAL Widescreen TV episodes which I captured in MPEG2 but I want to convert them to XVID using FFMPEG.

At the moment I'm using the following command line to encode it using 1-pass but the quality isn't as good as I would expect for the filesize.


-i {SOURCE_FILE} -deinterlace -vcodec mpeg4 -g 240 -b 1200k -croptop 0 -cropbottom 0 -aspect 16:9 -s 640x360 -acodec mp3 -ab 128 -ac 2 -mbd 2 -vtag xvid -qmin 2 -async 1 -y {DEST_FILE}" targetExtension=".avi"

Can anyone tell me what I should use if I want to do a 2-pass?

Any other suggestions about what command line options to use would also be appreciated.

Thanks

ilovejedd
1st March 2007, 15:32
ffmpeg -i {SOURCE_FILE} -deinterlace -vcodec mpeg4 -g 240 -qscale 2 -croptop 0 -cropbottom 0 -aspect 16:9 -s 640x360 -passlogfile {LOG_FILE} -pass 1 -mbd 2 -vtag xvid -an -y -f avi NUL
ffmpeg -i {SOURCE_FILE} -deinterlace -vcodec mpeg4 -g 240 -b 1200k -croptop 0 -cropbottom 0 -aspect 16:9 -s 640x360 -passlogfile {LOG_FILE} -pass 2 -acodec mp3 -ab 128 -ac 2 -mbd 2 -vtag xvid -qmin 2 -async 1 -y -f avi {DEST_FILE}

If you have xvid enabled during compile, then use -vcodec xvid instead of -vcodec mpeg4 -vtag xvid. The mpeg4 codec is just a standard implementation so xvid should (at least theoretically) look better.

Also, if you don't care about filesize, then maybe you can use a constant quality scale instead of bitrate (-qscale n, lower n, the better).

Top_Cat
1st March 2007, 16:54
Thanks for your reply. Do I just use the whole thing in the command line or do I need to launch ffmpeg twice, once for the first pass and then launch it again for the second?

The reason I ask is because I am trying to use ffmpeg in conjunction with GB-PVR which will automatically call ffmpeg and encode.

ilovejedd
1st March 2007, 17:21
That's twice. I'm not too familiar with the other options you used so I left them as is. I just know one is for macrodeblocking and the other is for quantizer scale. You could get rid of -croptop 0 -cropbottom 0 -aspect 16:9 from the command line as they're not really doing anything.

The first pass does not generate AVI output. It's just there for creating the stats/log file. That's why I removed the audio related stuff. Oops, made a mistake in the code. There should be a -an. Will go edit it now.