1

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

Veehmot
  • 212
  • 3
  • 11

2 Answers2

1

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".

slhck
  • 235,242
-1

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