[FFmpeg-devel] [PATCH] Set AVSTREAM_PARSE_HEADERS flag for AV1 MP4 streams.

ManojGuptaBonda mbonda at nvidia.com
Wed Aug 19 12:50:35 EEST 2020


From: Vikas Agarwal <vikasa at nvidia.com>

It allow AV1 header parsing and help initialize chroma format and other
info properly.

Chroma format wasn't correct if we use below code:

avformat_find_stream_info(fmtc, NULL); iVideoStream =
av_find_best_stream(fmtc, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
eChromaFormat = (AVPixelFormat)fmtc->streams[iVideoStream]->codecpar->
 format;
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1532e74d67..4d4b5c0f48 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7615,6 +7615,8 @@ static int mov_read_header(AVFormatContext *s)
             av_log(s, AV_LOG_VERBOSE, "Forcing full parsing for mp3 stream\n");
             st->need_parsing = AVSTREAM_PARSE_FULL;
         }
+        if (st->codecpar->codec_id == AV_CODEC_ID_AV1)
+            st->need_parsing = AVSTREAM_PARSE_HEADERS;
     }
 
     if (mov->trex_data) {
-- 
2.17.1



More information about the ffmpeg-devel mailing list