Tuesday, May 10, 2011

Using ffmpeg to encode a high quality video

I had acquired some high quality images and was willing to encode them into a video, but ffmpeg default settings was always outputting a ugly video which had 1280x720, but with lots of artifacts.

After googling a little, I've found:

http://stackoverflow.com/questions/3561715/using-ffmpeg-to-encode-a-high-quality-video

Digging a little more on the comments I've found:

You need to specify the -vb option to increase the video bitrate, otherwise you get the default which produces smaller videos but with more artifacts.

Try something like this:


ffmpeg -r 25 -i %4d.png -vb 20M myvideo.mpg

So, the key was the -vb flag!

ffmpeg -i Image-%d.jpg -s 1280x720 -aspect 16:9 -r 24 -vb 20M teste.mp4