diff options
author | Tristan Matthews <tmatth@videolan.org> | 2017-12-10 18:28:50 -0500 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-12-13 15:10:07 +0000 |
commit | e8f0a463b0d27a4d74c0d9f1857e72a8033d1069 (patch) | |
tree | acee249d063fdb5930b3635f4130fc272399a73d /libavformat | |
parent | 309ddcbe61662282d91098029e7f9796acec208c (diff) | |
download | ffmpeg-e8f0a463b0d27a4d74c0d9f1857e72a8033d1069.tar.gz |
ivfenc: add AV1 support
libaom tools work with ivf files.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/ivfenc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c index fdc0ee03e1..f591327a21 100644 --- a/libavformat/ivfenc.c +++ b/libavformat/ivfenc.c @@ -37,14 +37,17 @@ static int ivf_write_header(AVFormatContext *s) } par = s->streams[0]->codecpar; if (par->codec_type != AVMEDIA_TYPE_VIDEO || - !(par->codec_id == AV_CODEC_ID_VP8 || par->codec_id == AV_CODEC_ID_VP9)) { - av_log(s, AV_LOG_ERROR, "Currently only VP8 and VP9 are supported!\n"); + !(par->codec_id == AV_CODEC_ID_VP8 || par->codec_id == AV_CODEC_ID_VP9 || + par->codec_id == AV_CODEC_ID_AV1)) { + av_log(s, AV_LOG_ERROR, "Currently only VP8, VP9 and AV1 are supported!\n"); return AVERROR(EINVAL); } avio_write(pb, "DKIF", 4); avio_wl16(pb, 0); // version avio_wl16(pb, 32); // header length - avio_wl32(pb, par->codec_tag ? par->codec_tag : par->codec_id == AV_CODEC_ID_VP9 ? AV_RL32("VP90") : AV_RL32("VP80")); + avio_wl32(pb, par->codec_tag ? par->codec_tag : + par->codec_id == AV_CODEC_ID_VP9 ? AV_RL32("VP90") : + par->codec_id == AV_CODEC_ID_VP8 ? AV_RL32("VP80") : AV_RL32("AV01")); avio_wl16(pb, par->width); avio_wl16(pb, par->height); avio_wl32(pb, s->streams[0]->time_base.den); @@ -100,6 +103,7 @@ static int ivf_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt) static const AVCodecTag codec_ivf_tags[] = { { AV_CODEC_ID_VP8, MKTAG('V', 'P', '8', '0') }, { AV_CODEC_ID_VP9, MKTAG('V', 'P', '9', '0') }, + { AV_CODEC_ID_AV1, MKTAG('A', 'V', '0', '1') }, { AV_CODEC_ID_NONE, 0 } }; |