Page 1 of 1

XnView MP does not display multi-image AVIF

Posted: Fri Dec 22, 2023 7:27 pm
by dma_k
Dear community,

I have created AVIF file from the series of PNG images

Code: Select all

D:\> ffmpeg -y -i "%d.png" -c:v av1 output.avif

Input #0, image2, from '%d.png':
  Duration: 00:00:00.32, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: png, rgb24(pc, gbr/unknown/unknown), 2552x3508 [SAR 11811:11811 DAR 638:877], 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> av1 (libaom-av1))
Press [q] to stop, [?] for help
[libaom-av1 @ 000001c99732d300] 3.7.0-636-g7e1dfee837
[libaom-av1 @ 000001c99732d300] Neither bitrate nor constrained quality specified, using default CRF of 32
Output #0, avif, to 'output.avif':
  Metadata:
    encoder         : Lavf60.16.100
  Stream #0:0: Video: av1 (av01 / 0x31307661), gbrp(pc, gbr/unknown/unknown, progressive), 2552x3508 [SAR 1:1 DAR 638:877], q=2-31, 25 fps, 12800 tbn (default)
    Metadata:
      encoder         : Lavc60.31.102 libaom-av1
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=N/A bitrate=N/A speed=N/A    
frame=    0 fps=0.0 q=0.0 size=       0kB time=N/A bitrate=N/A speed=N/A    
[out#0/avif @ 000001c99732c280] video:3688kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.028071%
frame=    8 fps=0.0 q=0.0 Lsize=    3689kB time=00:00:00.28 bitrate=107918.2kbits/s speed=0.000286x    
It is expected that this file is displayed by XnView MP as multi-paged image. However XnView MP v1.6.3 does not display this image at all:
XnView MP.png
XnView MP.png (3.15 KiB) Viewed 3870 times
ExifTool:

Code: Select all

[ExifTool]      ExifTool Version Number         : 12.26
[QuickTime]     AV1 Configuration Version       : 1
[QuickTime]     Chroma Format                   : YUV 4:4:4
[QuickTime]     Chroma Sample Position          : Unknown
[QuickTime]     Color Representation            : nclx 2 2 0
[QuickTime]     Compatible Brands               : avis, avif, msf1, iso8, mif1, miaf, MA1A
[QuickTime]     Create Date                     : 0000:00:00 00:00:00
[QuickTime]     Current Time                    : 0 s
[QuickTime]     Duration                        : 0.32 s
[QuickTime]     Graphics Mode                   : srcCopy
[QuickTime]     Handler Description             : PictureHandler
[QuickTime]     Handler Type                    : Picture
[QuickTime]     Image Height                    : 3508
[QuickTime]     Image Pixel Depth               : 8 8 8
[QuickTime]     Image Spatial Extent            : 2552x3508
[QuickTime]     Image Width                     : 2552
[QuickTime]     Major Brand                     : Unknown (avis)
[QuickTime]     Matrix Structure                : 1 0 0 0 1 0 0 0 1
[QuickTime]     Media Create Date               : 0000:00:00 00:00:00
[QuickTime]     Media Data Offset               : 1076
[QuickTime]     Media Data Size                 : 3776061
[QuickTime]     Media Duration                  : 0.32 s
[QuickTime]     Media Header Version            : 0
[QuickTime]     Media Language Code             : und
[QuickTime]     Media Modify Date               : 0000:00:00 00:00:00
[QuickTime]     Media Time Scale                : 12800
[QuickTime]     Minor Version                   : 0.0.0
[QuickTime]     Modify Date                     : 0000:00:00 00:00:00
[QuickTime]     Movie Header Version            : 0
[QuickTime]     Next Track ID                   : 2
[QuickTime]     Op Color                        : 0 0 0
[QuickTime]     Other Format                    : av01
[QuickTime]     Poster Time                     : 0 s
[QuickTime]     Preferred Rate                  : 1
[QuickTime]     Preferred Volume                : 100.00%
[QuickTime]     Preview Duration                : 0 s
[QuickTime]     Preview Time                    : 0 s
[QuickTime]     Primary Item Reference          : 1
[QuickTime]     Selection Duration              : 0 s
[QuickTime]     Selection Time                  : 0 s
[QuickTime]     Time Scale                      : 1000
[QuickTime]     Track Create Date               : 0000:00:00 00:00:00
[QuickTime]     Track Duration                  : 106751991167 days 7:12:56
[QuickTime]     Track Header Version            : 1
[QuickTime]     Track ID                        : 1
[QuickTime]     Track Layer                     : 0
[QuickTime]     Track Modify Date               : 0000:00:00 00:00:00
[QuickTime]     Track Volume                    : 0.00%
[Composite]     Avg Bitrate                     : 94.4 Mbps
[Composite]     Image Size                      : 2552x3508
[Composite]     Megapixels                      : 9.0

Re: XnView MP does not display multi-image AFIV

Posted: Thu Dec 28, 2023 9:34 am
by xnview
is it possible to have the file?

Re: XnView MP does not display multi-image AFIV

Posted: Tue Aug 27, 2024 12:52 am
by dma_k
I have attached the test data including target AVIF, which is produced with the following command:

Code: Select all

ffmpeg -f concat -i file_list.txt -c copy output.avif
ffmpeg for Windows was downloaded from here:

Code: Select all

C:\> ffmpeg --version
ffmpeg version 7.0.2-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
XnView MP v1.6.3.

Re: XnView MP does not display multi-image AFIV

Posted: Tue Aug 27, 2024 7:08 am
by xnview
ok thanks i'll check

Re: XnView MP does not display multi-image AVIF

Posted: Wed Nov 13, 2024 9:04 am
by dma_k
Link to similar issue for ImageGlass. It seems that quite a few image viewers struggle with the same issue.

Re: XnView MP does not display multi-image AVIF

Posted: Mon May 05, 2025 3:38 pm
by xnview
:bugconfirmed: Thanks to your detailed description I can reproduce the problem.

Re: XnView MP does not display multi-image AVIF

Posted: Mon May 26, 2025 6:30 am
by xnview
This problem is supposed to be fixed in XnView MP 1.9.0. Please check and confirm the bug fix here.

Re: XnView MP does not display multi-image AVIF

Posted: Mon May 26, 2025 12:18 pm
by dma_k
I just checked the file output.avif from ZIP I've attached above and I don't see any significant difference: I would expect that "Previous page" / "Next page" menu items are enabled and working properly navigating to next/previous sub-imge in output.avif.
xnview-1.9.0-avif-page.jpg
xnview-1.9.0-avif-page.jpg (67.42 KiB) Viewed 247 times

Re: XnView MP does not display multi-image AVIF

Posted: Mon May 26, 2025 1:52 pm
by adrem85
Unfortunately, I did not find support for multi-page AVIF in version 1.9.0. The program shows this file (output.avif) as a single page (first page). And these files cannot be opened at all. Error when opening “failed to upload file”... At the same time these files open normally in some other viewers (Imagine, QIMGV).

Re: XnView MP does not display multi-image AVIF

Posted: Mon May 26, 2025 2:18 pm
by xnview
the fix was to display correctly the first frame. Currently there is problems to get others frames with libheif

Re: XnView MP does not display multi-image AVIF

Posted: Mon May 26, 2025 7:58 pm
by dma_k
Thanks for update! So, we can say that multi-image AVIF is still in "to be fixed" state, right?
xnview wrote: Mon May 26, 2025 2:18 pm the fix was to display correctly the first frame. Currently there are problems to get others frames with libheif
Has it something to do with issue 377 / issue 1371?
Why cannot you use libavif library, in particular avifDecoderNthImage() function?

Re: XnView MP does not display multi-image AVIF

Posted: Wed May 28, 2025 12:59 am
by foxyshadis
dma_k wrote: Mon May 26, 2025 7:58 pm Thanks for update! So, we can say that multi-image AVIF is still in "to be fixed" state, right?
xnview wrote: Mon May 26, 2025 2:18 pm the fix was to display correctly the first frame. Currently there are problems to get others frames with libheif
Has it something to do with issue 377 / issue 1371?
Why cannot you use libavif library, in particular avifDecoderNthImage() function?
Sequence support is in the current libheif head and will be available in 1.20. It's a big deal to completely switch APIs without a really good reason, and a corner case few people use yet usually isn't it, so you might have to wait a bit for the update.

But some people want sequences to mean separate pages that you individually scroll through one at a time, and some people want them to be gif-style animations. Now you have a big problem, how to handle both of these competing interests. (In fact, I'd say far more people want them to work like gif/apng rather than multi-page tiff, from everything I've seen.)

Re: XnView MP does not display multi-image AVIF

Posted: Wed May 28, 2025 12:33 pm
by dma_k
foxyshadis wrote: Wed May 28, 2025 12:59 am Now you have a big problem, how to handle both of these competing interests. (In fact, I'd say far more people want them to work like gif/apng rather than multi-page tiff, from everything I've seen.)
I am not sure where the conflict of interests is. In order to play sequence of images as animated GIF one needs API to access images individually. So next to buttons "Previous page" / "Next page" there could be buttons "Play" and "Pause". I am not sure if AVIF supports storing of animation delay (delay how long each frame should be shown), but if not, then all necessary options that are not part of AVIF could be a part of settings, like "[x] Automatically start animation for multi-page AVIF" and "[...] Default animation delay". Would it be a win/win solution?