Extract the image

Problem

Extract the image stream from an audio-visual 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 may be abbreviated as -c:v (or -codec:v or -c:video). We advise to avoid the alias -vcodec.


2018–05–18