[FFmpeg-devel] [PATCH] avcodec/libdav1d: parse sequence headers in extradata if available
James Almer
jamrial at gmail.com
Sun Jul 11 16:07:13 EEST 2021
On 7/11/2021 8:40 AM, Derek Buitenhuis wrote:
> 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.
I can amend this patch locally to check for DAV1D_ERR(ENOENT), which was
implemented to signal "No seqhdr is present", and return 0 in that case,
but it's a very recent addition, so older libdav1d builds will never
emit that error code.
Guess just returning 0 on all scenarios here until we increase the
minimum required library version is better, so I'll do that.
>
> - Derek
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
More information about the ffmpeg-devel
mailing list