FFmpeg筆記--vcodec和-c:v,-acodec和-c:a的區別?

在看ffmpeg命令的時候經常會看到有些地方使用--vcodec指定視頻解碼器,而有些地方使用-c:v指定視頻解碼器,那這兩個有沒有區別呢?

ffmpeg的官方文檔:

-vcodec codec (output)
  Set the video codec. This is an alias for -codec:v.

也就是說-vcodec-codec:v等價。但是並沒有說和-c:v等價啊。看一下-codec:v的文檔:

-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.

也就是說-codec-c是等價的。所以--vcodec-c:v是等價的。

文檔說明-codec可以爲指定的流設置編碼器,具體通過stream_specifier來指定。

-ab和-b參數去哪裏了?

在看資料的時候發現有些文字中用到了-ab-b參數,但是官網文檔沒有這兩個參數。。

後來通過ffmpeg- h發現了這兩個參數:

-ab bitrate         audio bitrate (please use -b:a)
-b bitrate          video bitrate (please use -b:v)

可以看出這兩個參數分別設定音頻比特率和視頻比特率,但是已經不推薦使用這種寫法了,改爲使用-b:a-b:v

參考資料

本文獨立博客地址:FFmpeg筆記--vcodec和-c:v,-acodec和-c:a的區別? | 木杉的博客

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章