Before I ask I want to say that I know about ImageMagick and the other image processing tools but I explicitly need to use ffmpeg.

So, can someone tell me if there's a way to use ffmpeg to convert an image ( in any of the common formats ) to a jpeg format. I also need to scale it. Until now I've come with this:

ffmpeg -i <input-file> -vf "scale=<output-width>:-1" <output-file>

Any suggestion will be appreciated : )

migrated from stackoverflow.com Jun 12 '13 at 17:15

This question came from our site for professional and enthusiast programmers.

  • This might be a better question for superuser (or just read this ffmpeg.org/…) – vipw Jun 12 '13 at 13:34
  • Your command looks fine to me. Have you tried it? You can increase output quality for jpeg output with -qscale:v. Try a value between 2-5. A lower value is a higher quality. – llogan Jun 12 '13 at 16:49
  • The command works as expected, but it produces a green overlay which I do not know how can be removed. Any ideas? – user931392 Jun 21 '13 at 10:54
  • Please include the complete ffmpeg console output (and this should be a standard practice when asking ffmpeg usage questions). – llogan Jun 21 '13 at 16:19
  • @user931392 IMHO the green overlay may be caused by conversion between different pixel formats or color spaces. Are you sure the problem isn't unique to FFmpeg and occurs with alternatives like ImageMagick? – minmaxavg Oct 13 '17 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.