Opened 22 months ago
Last modified 15 months ago
#11201 new defect
Atypical AVIF stream handling in FFmpeg 7: Misaligning major implementations
| Reported by: | nmp5 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | avformat |
| Version: | git-master | Keywords: | mov regression |
| Cc: | MasterQuestionable, Martin | Blocked By: | |
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | yes |
Description
I can no longer convert animated AVIF to MP4 when using ffmpeg v7. It does convert, but the MP4 doesn't show the animation. Just the first frame or so.
While, with ffmpeg v6, it works well (animation shown perfectly in the MP4 file, and file size bigger than the MP4 file created by ffmpeg v7).
I tried this in Alpine docker, and on Windows.
In the attachments, I include:
- the original AVIF file
- the various logs for each of the commands I ran (with the command in the first line, for reference), with "-v trace"
- the outputs produced (animated-avif-ffmpeg-6-apk.mp4 and animated-avif-ffmpeg-6-static.mp4 are the expected outputs)
- the output of "ffmpeg -v 9 -loglevel 99 -i"
Attachments (6)
Change History (19)
by , 22 months ago
| Attachment: | animated-avif-trace.zip added |
|---|
comment:1 by , 22 months ago
| Cc: | added |
|---|---|
| Component: | undetermined → avcodec |
| Keywords: | libdav1d added; avif removed |
| Summary: | Animated AVIF converts well to mp4 in ffmpeg v6, but not in v7 → Animated AVIF decoding regression (7.0.2 ~ 6.1.1) |
| Version: | unspecified → git-master |
by , 22 months ago
| Attachment: | animated-avif-trace-2.zip added |
|---|
comment:2 by , 22 months ago
Hello. I tried adding "-ignore_editlist 1" before "-v trace", using ffmpeg v7, but the output was still the same.
However, if I add "-map 0:2", it works. This is because ffmpeg 7 for some reason demuxes the input file into 4 streams, while ffmpeg 6 wasn't.
(I had originally opened this issue here - https://github.com/wader/static-ffmpeg/issues/530 - and the owner of the repo noticed the "demuxing" difference.)
Is this intentional behavior?
If so, how can I make the command figure out what stream to select so it selects the correct one? (to get the behavior of ffmpeg 6)
I attached 4 more files. The "map02.mp4" one is the expected output (but with "-map 0:2" hardcoded in the command).
Thank you.
comment:3 by , 22 months ago
| Component: | avcodec → avformat |
|---|---|
| Keywords: | mov added |
͏ Input option is to be placed before "-i".
͏ You applied "-ignore_editlist" as output; and for this case it would be silent no-op...
͏ https://trac.ffmpeg.org/ticket/11030#comment:5
͏ Probably of "avformat" cause:
͏ https://github.com/FFmpeg/FFmpeg/commit/41e349c24a726d0c3bac5830eec9f6940ea41c63
͏ I don't use AVIF, so pardon my limited understanding.
͏ But generally, such multi-primary-stream medias tend to be problematic in current implementations.
͏ (container inaptness)
͏ Caveat that metadata may play a factor in such cases.
͏ (you used "-map_metadata -1": that unmaps most metadata)
by , 22 months ago
| Attachment: | animated-avif-trace-3.zip added |
|---|
comment:4 by , 22 months ago
Hello. Thank you. I added another attachment with the result with "-ignore_editlist 1" before "-i", and without "-map_metadata -1". Still not working.
comment:5 by , 22 months ago
͏ Thanks for your feedback.
͏ I wonder, what material is it in each of these streams..?
͏ As it seems, you expected only 1 of the all?
comment:6 by , 22 months ago
Thank you. I don't understand the question. What do you mean "material"?
I really just expect it to behave the same way as in ffmpeg v6, where the output contains all the frames of the animated image :)
by , 22 months ago
| Attachment: | animated-avif.avif added |
|---|
͏ 7.0.2:
[[
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'animated-avif.avif':
͏ Metadata:
͏ major_brand : avis
͏ minor_version : 0
͏ compatible_brands: avifavismsf1iso8mif1miafMA1A
͏ creation_time : 2024-09-03T13:00:28.000000Z
͏ comment : AVIFS created with https://ezgif.com/avif-maker
͏ Duration: 00:00:01.50, start: 0.000000, bitrate: 44 kb/s
͏ Stream #0:0[0x1], 1, 1/1: Video: av1 (libdav1d) (High), 1 reference frame (av01 / 0x31307661), yuv444p(pc, smpte170m/bt709/iec61966-2-1), 169x98 [SAR 1:1 DAR 169:98], 0/1, 1 fps, 1 tbr, 1 tbn (default)
͏ Metadata:
͏ title : Color
͏ Stream #0:1[0x2], 1, 1/1: Video: av1 (libdav1d) (Main), 1 reference frame (av01 / 0x31307661), gray(pc), 169x98 [SAR 1:1 DAR 169:98], 0/1, 1 fps, 1 tbr, 1 tbn
͏ Metadata:
͏ title : Alpha
͏ Stream #0:2[0x1](und), 10, 1/1000: Video: av1 (libdav1d) (High), 1 reference frame (av01 / 0x31307661), yuv444p(pc, smpte170m/bt709/iec61966-2-1), 169x98 [SAR 1:1 DAR 169:98], 0/1, 32 kb/s, 6.67 fps, 6.67 tbr, 1k tbn (default)
͏ Metadata:
͏ creation_time : 2024-09-03T13:00:28.000000Z
͏ handler_name : libavif
͏ vendor_id : [0][0][0][0]
͏ encoder : AOM Coding
͏ Stream #0:3[0x2](und), 10, 1/1000: Video: av1 (libdav1d) (Main), 1 reference frame (av01 / 0x31307661), gray(pc), 169x98 [SAR 1:1 DAR 169:98], 0/1, 0 kb/s, 6.67 fps, 6.67 tbr, 1k tbn (default)
͏ Metadata:
͏ creation_time : 2024-09-03T13:00:28.000000Z
͏ handler_name : libavif
͏ vendor_id : [0][0][0][0]
͏ encoder : AOM Coding
]]
͏ 6.1.1:
[[
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'animated-avif.avif':
͏ Metadata:
͏ major_brand : avis
͏ minor_version : 0
͏ compatible_brands: avifavismsf1iso8mif1miafMA1A
͏ creation_time : 2024-09-03T13:00:28.000000Z
͏ comment : AVIFS created with https://ezgif.com/avif-maker
͏ Duration: 00:00:01.50, start: 0.000000, bitrate: 44 kb/s
͏ Stream #0:0[0x1](und), 1, 1/1000: Video: av1 (High), 1 reference frame (av01 / 0x31307661), yuv444p(pc, smpte170m/bt709/iec61966-2-1), 169x98 [SAR 1:1 DAR 169:98], 0/1, 32 kb/s, 6.67 fps, 6.67 tbr, 1k tbn (default)
͏ Metadata:
͏ creation_time : 2024-09-03T13:00:28.000000Z
͏ handler_name : libavif
͏ vendor_id : [0][0][0][0]
͏ encoder : AOM Coding
͏ Stream #0:1[0x2](und), 7, 1/1000: Video: av1 (Main), 1 reference frame (av01 / 0x31307661), gray(pc), 169x98 [SAR 1:1 DAR 169:98], 0/1, 0 kb/s, 6.67 fps, 6.67 tbr, 1k tbn (default)
͏ Metadata:
͏ creation_time : 2024-09-03T13:00:28.000000Z
͏ handler_name : libavif
͏ vendor_id : [0][0][0][0]
͏ encoder : AOM Coding
]]
comment:7 by , 22 months ago
| Keywords: | libdav1d removed |
|---|
͏ Probably related how EzGIF processes the files?
͏ Your claimed "all frames" actually only contain part of the frames:
͏ Which means the file itself contained materials no-use for you.
comment:8 by , 22 months ago
Maybe. I'm not really an expert in animated image files or videos. What I'm saying is that with ffmpeg v6 I got a video that showed the same animation as in the AVIF file, while with ffmpeg v7, I didn't. Thanks.
comment:9 by , 22 months ago
| Summary: | Animated AVIF decoding regression (7.0.2 ~ 6.1.1) → Animated AVIF decoding regression (7.0.2 ~ 6.1.1): Unexpected extra streams |
|---|
comment:10 by , 22 months ago
| Summary: | Animated AVIF decoding regression (7.0.2 ~ 6.1.1): Unexpected extra streams → Animated AVIF demuxing regression (7.0.2 ~ 6.1.1): Unexpected extra streams |
|---|
͏ Note: AVIF appears to be some variant of MP4.
comment:11 by , 22 months ago
| Keywords: | regression added |
|---|---|
| Summary: | Animated AVIF demuxing regression (7.0.2 ~ 6.1.1): Unexpected extra streams → Atypical AVIF stream handling in FFmpeg 7: Misaligning major implementations |
comment:12 by , 15 months ago
| Cc: | added |
|---|
I'm having the same problem with a different animated AVIF created with ffmpeg. So, this issue isn't due to EzGIF's processing.
The only difference here is that ffmpeg v7 finds 2 streams instead of 4, unlike with the original reporter's file. Ffmpeg v6 found 1 stream.
I'll attach my sample file water.avif and the logs from ffmpeg v7 (water_log.txt).
by , 15 months ago
| Attachment: | water.avif added |
|---|
by , 15 months ago
| Attachment: | water_log.txt added |
|---|
comment:13 by , 15 months ago
| Analyzed by developer: | set |
|---|
͏ So fundamentally because of the AVIF stream handling:
͏ Changed incompatibly between FFmpeg 6 and 7.
͏ (why?)



͏ See comment:10.
͏ ----
͏ Or maybe related with "avformat": try "-ignore_editlist 1"? (input option)