FFmpeg WebM AV1支持

时间:2018-07-13 02:18:36

标签: encoding ffmpeg webm

如何使用FFmpeg在AV1容器中使用webm编解码器?

我得到了错误:

Only VP8 or VP9 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --

但是,维基百科说WebM支持AV1。

https://en.wikipedia.org/wiki/AV1

AV1 is intended to be able to be used together with the audio format Opus in a future version of the WebM container format for HTML5 web video

还是FFmpeg不能简单地对此新版本进行编码?


我的设置:

ffmpeg -y 

-i "C:\Users\Matt\video.mp4" 

-c:v libaom-av1 -strict experimental 
-cpu-used 1 -crf 28 
-pix_fmt yuv420p 
-map 0:v:0? -map_chapters -1 
-sn 

-c:a libopus 
-map 0:a:0? 

-map_metadata 0 

-f webm 

-threads 0 

"C:\Users\Matt\video.webm"

1 个答案:

答案 0 :(得分:2)

ffmpeg当前不支持在WebM中混合AV1。 The error you're getting comes from this code

if (mkv->mode == MODE_WEBM && !(par->codec_id == AV_CODEC_ID_VP8 ||
                                par->codec_id == AV_CODEC_ID_VP9 ||
                                par->codec_id == AV_CODEC_ID_OPUS ||
                                par->codec_id == AV_CODEC_ID_VORBIS ||
                                par->codec_id == AV_CODEC_ID_WEBVTT)) {
    av_log(s, AV_LOG_ERROR,
           "Only VP8 or VP9 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM.\n");
    return AVERROR(EINVAL);
}

请注意表达式中缺少AV_CODEC_ID_AV1

这并不奇怪。 Matroska中的AV1(以及WebM)尚未完成。如果要关注Matroska(和WebM)在AV1上的进展,请follow the discussion here on the IETF CELLAR mailing list