diff mbox series

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

Message ID 20200819095035.27557-1-mbonda@nvidia.com
State New
Headers show
Series [FFmpeg-devel] Set AVSTREAM_PARSE_HEADERS flag for AV1 MP4 streams.
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

ManojGuptaBonda Aug. 19, 2020, 9:50 a.m. UTC
From: Vikas Agarwal <vikasa@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(+)

Comments

James Almer Aug. 19, 2020, 3:29 p.m. UTC | #1
On 8/19/2020 6:50 AM, ManojGuptaBonda wrote:
> From: Vikas Agarwal <vikasa@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;

Could you add this at the end of mov_finalize_stsd_codec() instead?

>      }
>  
>      if (mov->trex_data) {
>
diff mbox series

Patch

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) {