[FFmpeg-devel] [PATCH] avcodec/libdav1d: parse sequence headers in extradata if available

Derek Buitenhuis derek.buitenhuis at gmail.com
Sun Jul 11 14:40:16 EEST 2021


On 7/9/2021 3:53 PM, James Almer wrote:
> +    res = dav1d_parse_sequence_header(&seq, c->extradata + offset,
> +                                      c->extradata_size  - offset);
> +    if (res < 0) {
> +        av_log(c, explode ? AV_LOG_ERROR : AV_LOG_INFO,
> +               "Error decoding extradata\n");
> +        return explode ? AVERROR_INVALIDDATA : 0;
> +    }
> +

I don't think it is a good idea to fail like this, even in explode
mode.

Both the AV1-in-ISOBMFF and AV1-in-Matroska specs do specify that
the sequence header OBU must be first if there is one in the
configOBUs, however, they do not require on actually be present.

For example, configOBUs may contain a single metadata OBU, and
nothing else - and it would be entirely valid - so failing here
would actually be wrong, even in explode mode. This can happen,
if, for example, you have a file with HDR metadata in the av1c box,
but in-band sequence headers.

- Derek


More information about the ffmpeg-devel mailing list