Extract image

Problem

Extract the image stream from an audiovisual file.

Solution

ffmpeg \
    -i input_file \
    -c:v copy \
    -an \
    output_file

Command syntax

ffmpeg
starts the command
-i input_file
path, name and extension of the input file
-c:v copy
re-encodes using the same video codec
-an
no audio stream (mnemonically «audio no»)
output_file
path, name and extension of the output file

Discussion

Only the image stream is copied into the output file by keeping the same video codec as the input file.

The video codec is specified by -codec:video, which is usually abbreviated as -c:v (-codec:v or -c:video are also possible). We advise to avoid the alias -vcodec.


2020-07-15