FFmpeg notes --vcodec and -c: v, -acodec and -c: a difference?

When looking at ffmpeg command often see in some places using --vcodecthe specified video decoder, and in some places the use of -c:vspecified 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 -vcodecand -codec:vequivalence. But he did not say that and -c:vequivalence ah. Look at -codec:vthe 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 -codecand -care equivalent. So --vcodecand -c:vare equivalent.

-Codec documentation may be specified stream encoder is provided, in particular by stream_specifierspecified.

Where -ab and -b parameters go?

When looking at the information we found some text uses -aband -bparameters, but the document is not the official website of these two parameters. .

Later, through the ffmpeg- hdiscovery 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

Published 24 original articles · won praise 13 · views 40000 +

Guess you like

Origin blog.csdn.net/mazhibinit/article/details/104219188