[FFmpeg-cvslog] avformat/flvdec: support demux av1 in enhanced flv

Steven Liu git at videolan.org
Tue Jul 18 04:47:12 EEST 2023


ffmpeg | branch: master | Steven Liu <lq at chinaffmpeg.org> | Thu Apr 13 14:25:27 2023 +0800| [23b02557e94af438d2af06b477bfd1e513708dce] | committer: Steven Liu

avformat/flvdec: support demux av1 in enhanced flv

Tested-by: Tristan Matthews <tmatth at videolan.org>
Tested-by: Neal Gompa <ngompa13 at gmail.com>
Reviewed-by: Tristan Matthews <tmatth at videolan.org>
Reviewed-by: Neal Gompa <ngompa13 at gmail.com>
Signed-off-by: Steven Liu <lq at chinaffmpeg.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=23b02557e94af438d2af06b477bfd1e513708dce
---

 libavformat/flvdec.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index c8e6cadf1c..a0362ff11c 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -318,6 +318,8 @@ static int flv_same_video_codec(AVFormatContext *s, AVCodecParameters *vpar, int
         switch(codec_id) {
             case MKBETAG('h', 'v', 'c', '1'):
                 return vpar->codec_id == AV_CODEC_ID_HEVC;
+            case MKBETAG('a', 'v', '0', '1'):
+                return vpar->codec_id == AV_CODEC_ID_AV1;
             default:
                 break;
         }
@@ -359,6 +361,10 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
                 par->codec_id = AV_CODEC_ID_HEVC;
                 vstreami->need_parsing = AVSTREAM_PARSE_HEADERS;
                 return 4;
+            case MKBETAG('a', 'v', '0', '1'):
+                par->codec_id = AV_CODEC_ID_AV1;
+                vstreami->need_parsing = AVSTREAM_PARSE_HEADERS;
+                return 4;
             default:
                 break;
         }
@@ -1278,7 +1284,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 && stream_type == FLV_STREAM_TYPE_VIDEO) {
             type = flags & 0x0F;
@@ -1309,7 +1316,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) {



More information about the ffmpeg-cvslog mailing list