@@ -319,6 +319,9 @@ static int flv_same_video_codec(AVFormatContext *s, AVCodecParameters *vpar, int
case MKBETAG('h', 'v', 'c', '1'):
flv_codecid = FLV_CODECID_HEVC;
break;
+ case MKBETAG('a', 'v', '0', '1'):
+ flv_codecid = FLV_CODECID_AV1;
+ break;
default:
break;
}
@@ -339,6 +342,8 @@ static int flv_same_video_codec(AVFormatContext *s, AVCodecParameters *vpar, int
return vpar->codec_id == AV_CODEC_ID_H264;
case FLV_CODECID_HEVC:
return vpar->codec_id == AV_CODEC_ID_HEVC;
+ case FLV_CODECID_AV1:
+ return vpar->codec_id == AV_CODEC_ID_AV1;
default:
return vpar->codec_tag == flv_codecid;
}
@@ -361,6 +366,9 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
case MKBETAG('h', 'v', 'c', '1'):
flv_codecid = FLV_CODECID_HEVC;
break;
+ case MKBETAG('a', 'v', '0', '1'):
+ flv_codecid = FLV_CODECID_AV1;
+ break;
default:
break;
}
@@ -408,6 +416,12 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
vstreami->need_parsing = AVSTREAM_PARSE_HEADERS;
ret = 3;
break;
+ case FLV_CODECID_AV1:
+ par->codec_id = AV_CODEC_ID_AV1;
+ vstreami->need_parsing = AVSTREAM_PARSE_HEADERS;
+ ret = 3;
+ break;
+
default:
avpriv_request_sample(s, "Video codec (%x)", flv_codecid);
par->codec_tag = flv_codecid;
@@ -1285,7 +1299,8 @@ retry_duration:
if (st->codecpar->codec_id == AV_CODEC_ID_AAC ||
st->codecpar->codec_id == AV_CODEC_ID_H264 ||
st->codecpar->codec_id == AV_CODEC_ID_MPEG4 ||
- st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
+ st->codecpar->codec_id == AV_CODEC_ID_HEVC ||
+ st->codecpar->codec_id == AV_CODEC_ID_AV1) {
int type = 0;
if (flv->exheader) {
type = flags & 0x0F;
@@ -1316,7 +1331,8 @@ retry_duration:
}
}
if (type == 0 && (!st->codecpar->extradata || st->codecpar->codec_id == AV_CODEC_ID_AAC ||
- st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC)) {
+ st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC ||
+ st->codecpar->codec_id == AV_CODEC_ID_AV1)) {
AVDictionaryEntry *t;
if (st->codecpar->extradata) {
Signed-off-by: Steven Liu <lq@chinaffmpeg.org> --- libavformat/flvdec.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)