Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm converting a set of images to avi, but the quality is very poor. How can I change the quality of a video?

This is my current command:

ffmpeg -i music.wav -f image2 -r 11 -i %%d.png video.avi

And you can see a still of the movie here, you can notice the bad quality:

enter image description here

share|improve this question
Avi is just the container. You need to look at the codec options too. Which codec you use would depend on what kind of device you plan to play back the video on and how large you want the final file to be. – nwaltham Dec 21 '11 at 3:11
avi and mpeg you can try for options of codecs. I did the same thing in one of my projects.. Another thing you can try is improve the fps. Even this will have effect on the final output.. – mk.. May 3 '12 at 10:20

If you don't give ffmpeg any specific option for the video codec to use, it will choose mpeg4 with the AVI container.

You can control the quality by setting either of these:

  • -q:v – choose anything between 1 and 31. Sane values are 3–5, where lower means better quality.
  • -b:v – choose a bit rate. Start with something around 1 MBit/s, e.g. -b:v 1M, and vary this according to your need.

For example:

ffmpeg -i music.wav -f image2 -r 11 -i %%d.png -c:v mpeg4 -q:v 3 video.avi

I would however recommend you to use the libx264 encoder (H.264) for better quality per bitrate. Here, you set the quality with:

  • -crf – anything between 18–28 is a sane choice. Lower means better.
  • -b:v – like above.

For example:

ffmpeg -i music.wav -f image2 -r 11 -i %%d.png -c:v libx264 -crf 20 video.mp4

Please do not use the sameq option – it doesn't mean "same quality".

share|improve this answer

Add the Same Quality Option : -sameq

This is what I do to convert image from my gopro to a movie :

Excelent Quality Resize to 1024x768 15 FPS

ffmpeg -r 15 -i %04d.JPG -s 1024x768 -sameq out.mp4

share|improve this answer
This option was removed from ffmpeg. It also doesn't mean "same quality" at all. See: What is the “sameq” or “same_quant” option in FFmpeg? – slhck Apr 28 '13 at 15:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .