Opened 7 months ago

Last modified 7 months ago

#9883 open enhancement

FFmpeg AVIF decoder does not seem to handle transparency when decoding YUV420P

Reported by: btdmaster Owned by:
Priority: wish Component: undetermined
Version: git-master Keywords: mov av1 alpha
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

FFmpeg seems to ignore transparency when decoding YUV420P. For example, compare the following:

% ffmpeg -i transparency-present.avif transparency-missing.png
% convert transparency-present.avif transparency-present.png
Arch Linux FFmpeg 2:5.1-1

This can also be reproduced when printing the file with ffplay and mpv (which, from what I understand, also used FFmpeg) but not with firefox or chafa, hence suggesting FFmpeg is the culprit.

I also found a similar limitation in libavif, though only for converting to yuv4mpeg2 (https://github.com/AOMediaCodec/libavif/blob/98a453fdbb0340eaf8bd6f794359483048e72305/apps/shared/y4m.c#L435):

% avifdec -i transparency-present.avif -o transparency-also-missing.y4m
Arch Linux libavif 0.10.1-2

FFmpeg does not seem to use libavif, but I thought that may provide some insight into the problem.

Attachments (1)

transparency-present.avif (9.7 KB ) - added by btdmaster 7 months ago.
Demonstrates AVIF transparency

Download all attachments as: .zip

Change History (4)

by btdmaster, 7 months ago

Attachment: transparency-present.avif added

Demonstrates AVIF transparency

comment:1 by btdmaster, 7 months ago

Blocking: #76217621

comment:3 by Carl Eugen Hoyos, 7 months ago

Blocking: 7621
Component: ffmpegundetermined
Keywords: mov av1 alpha added; transparent removed
Priority: normalwish
Type: defectenhancement
Version: unspecifiedgit-master
Note: See TracTickets for help on using tickets.