FFmpeg: Select specific decoder

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 338
Joined: Tue Nov 12, 2013 2:05 am

FFmpeg: Select specific decoder

Post by peter_b »

For some formats, FFmpeg may offer different encoders/decoders to choose from.
For encoding this is quite clear, as one has to specify which codec to use anyway - and therefore already choosing the desired encoder.

When decoding however the syntax for selecting which decoder is used is not that clear:
You specify the "codec" before the input filename.

For example if you want to framemd5 a Jpeg2000 file, you can choose between "libopenjpeg" and FFmpeg's internal/native decoder "jpeg2000":

Decoding using the native decoder:

Code: Select all

$ ffmpeg -c:v jpeg2000 -i INPUT -f framemd5 OUTPUT.framemd5
Using the OpenJPEG library:

Code: Select all

$ ffmpeg -c:v libopenjpeg -i INPUT -f framemd5 OUTPUT.framemd5
In the output, you will see the corresponding decoder actually used:
Stream mapping:
Stream #0:0 -> #0:0 (jpeg2000 (native) -> rawvideo (native))
Stream mapping:
Stream #0:0 -> #0:0 (jpeg2000 (libopenjpeg) -> rawvideo (native))

This is just an example using JPEG2000, but for other formats the principle is the same - only the names are different ;)
Post Reply