When looking at ffmpeg command often see in some places using --vcodec
the specified video decoder, and in some places the use of -c:v
specified video decoder, and that there is no difference between the two it?
ffmpeg official document:
-vcodec codec (output)
Set the video codec. This is an alias for -codec:v.
That -vcodec
and -codec:v
equivalence. But he did not say that and -c:v
equivalence ah. Look at -codec:v
the documentation:
-c[:stream_specifier] codec (input/output,per-stream)
-codec[:stream_specifier] codec (input/output,per-stream)
Select an encoder (when used before an output file) or a decoder (when used before an input file) for one or more streams. codec is the name of a decoder/encoder or a special value copy (output only) to indicate that the stream is not to be re-encoded.
For example
ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
encodes all video streams with libx264 and copies all audio streams.
For each stream, the last matching c option is applied, so
ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
will copy all the streams except the second video, which will be encoded with libx264, and the 138th audio, which will be encoded with libvorbis.
That -codec
and -c
are equivalent. So --vcodec
and -c:v
are equivalent.
-Codec documentation may be specified stream encoder is provided, in particular by stream_specifier
specified.
Where -ab and -b parameters go?
When looking at the information we found some text uses -ab
and -b
parameters, but the document is not the official website of these two parameters. .
Later, through the ffmpeg- h
discovery of these two parameters:
-ab bitrate audio bitrate (please use -b:a)
-b bitrate video bitrate (please use -b:v)
It can be seen that the two parameters are set audio bit rate and the video bit rate, but such an approach has not recommended, and to use -b:a
, and -b:v
.
Reference material
This article Independent blog address: FFmpeg and notes --vcodec -c: v, -acodec and -c: a difference? | Wood cedar blog