ffmpeg + mp4 encoding
Here’s two example ffmpeg commands for two-pass encoding:
First pass:ffmpeg -i <inputfile> -title “<title>” -vcodec mpeg4 -acodec libfaac -b 672k -ab 96k -ar 24000 -s 480×272 -aspect 16:9 -g 300 -aic 2 -mbd 2 -cmp 3 -precmp 3 -subcmp 3 -trellis 2 -flags +4mv+trell -pass 1 -f psp Video.mp4
Second pass:ffmpeg -i <inputfile> -title “<title>” -vcodec mpeg4 -acodec libfaac -b 672k -ab 96k -ar 24000 -s 480×272 -aspect 16:9 -g 300 -aic 2 -mbd 2 -cmp 3 -precmp 3 -subcmp 3 -trellis 2 -flags +4mv+trell -pass 2 -f psp Video.mp4
The meaning of the options:
-i <inputfile>
-title <title>
-acodec <audio codec>
-ab <audio bitrate>
-ar <audio rate>
-vcodec <video codec>
-b <video bitrate>
-s <resolution>
-aspect <aspect ratio>
-f <format>
All the other flags are options to optimize the video quality, at the expense of encoding speed.