Opened 2 years 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 2 years ago.
Demonstrates AVIF transparency

Download all attachments as: .zip

Change History (5)

by btdmaster, 2 years ago

Attachment: transparency-present.avif added

Demonstrates AVIF transparency

comment:1 by btdmaster, 2 years ago

Blocking: #76217621

comment:3 by Carl Eugen Hoyos, 2 years ago

Blocking: 7621
Component: ffmpegundetermined
Keywords: mov av1 alpha added; transparent removed
Priority: normalwish
Type: defectenhancement
Version: unspecifiedgit-master

comment:4 by Jozef Chutka, 7 months ago

Subscribing to this issue/thread. Using ffmpeg 6.1.1 it seem the issue still exists - patch not yet merged(?)

Note: See TracTickets for help on using tickets.