I sent this to Camelot One
, but figured I'd share with the forum, in case anyone else finds it useful. Basically, my perl script to run ffmpeg is constructing a command line like the below (for high quality). Hopefully people find it useful!
Here is an example command line. The -i argument is the input file, obviously, and the last argument is the output file. The rest of the flags are mostly stuff you don't need to change, but there are a few exceptions, noted below the command line:
quote:
ffmpeg -i input.avi -y -f mov -acodec libfaac -vcodec libx264 -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me umh -subq 5 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -refs 3 -bf 3 -trellis 1 -ab 128kb -b 1321k -f mov output.mov
•The ab argument sets the audio bitrate. You should set it to 128kb or higher, up to you. If the input source is only 128k, don't bother with a higher bitrate, it won't make much difference. If the input file's audio frequency is less than 22050 Hz, you'll want to add -ar 22050 to the command line, as anything less than 22050 isn't compatible with libfaac for some reason.
•The -bt argument is the video bitrate. My general rule of thumb here is, if it's an HD source, use the same bitrate as the input (e.g. if the input is an HD mkv container, use the same bitrate as the input video stream, which you can find with ffmpeg -i). If it's a non-HD input (e.g. xvid) I use -bt 1000 or -bt 2000 or just copy the input bitrate. H.264 at the same bitrate as Xvid will look better, but you're also going from one lossy codec to another, so your mileage may vary.

It's really a personal preference thing.
There are other arguments you may need (e.g. max bitrate) if you want to make sure the file isn't more than 10mbit/s, etc. But generally the above works.
Note: this is a one-pass encode, but I've had good luck with it quality wise. Looks great on my Samsung 720p DLP.
Hope this helps some folks out!