5

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 : )

5
  • This might be a better question for superuser (or just read this ffmpeg.org/…)
    – vipw
    Jun 12, 2013 at 13:34
  • 1
    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, 2013 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, 2013 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, 2013 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, 2017 at 21:59

2 Answers 2

4

I just asked myself the same question and thought I'd put an answer here even if I'm ten years late.

ffmpeg -i <input-file> <output-file>

This just worked fine for me, which video filter works for you depends on your FFmpeg version, which should always be provided when asking questions about FFmpeg.

Here is a more complex example with filters: https://stackoverflow.com/a/41355827/2010467

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.

I have the same or a very similar need and it is reasonable in some environments where you don't have access to the package manager or the package itself while you are already using a statically linked version of FFmpeg.

1

For reference, to convert all files in the current folder:

for f in *.webp; do ffmpeg -i "$f" "${f%.*}.png"; done

(from webp to png in this example)

You must log in to answer this question.

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