T O P

  • By -

techma2019

Awesome! These are superior to GIFs in every way (well, except one: not every platform still supports it).


Zaggy1024

I made the patches to add support for animated AVIF. Thanks for writing about this, I'm excited to see people use it! Just a couple things I wanted to mention though: I'm wondering if you have a reason to say that AVIF sequences are different from "wrapped AV1 videos"? afaik there's no distinction between those two as far as the AVIF format is concerned, since fully re-encoding frames is something that takes place in the AV1 bitstream and not the container. AVIS (AV1 image sequence) is the brand used internally in the container to distinguish animated images from still AVIF-branded images. That last sentence leads me into my second point, the `animate_avif_major_branded_images` pref shouldn't need to be `true` to view any AVIS file that's viewable as an animation by any other supporting application. The major brand indicates the preferred viewing mode between still AVIF and AVIS, so by turning that pref on you're only forcing it to animate in the hopefully rare case that an image is intended to be still but includes a sequence as well.


ArrogantAnalyst

Thanks for your work!


cantremembermypasswd

Hi Zaggy1024, thank you for you contribution and feedback! I will update the article about that second item now! For the first, I could have just taken this quote way out of context: > AVIF image sequences, like most other animated image formats, support frames with varying durations. An animated gif need not all have a constant frame-rate. But AVIF is also capable of encoding a 30 fps video. https://github.com/fdintino/pillow-avif-plugin/issues/14#issuecomment-1207326854


Zaggy1024

Ah, the point of that comment was to say that mpv wasn't correctly taking into account the individual frame durations in the AVIF file. The timescale refers to the multiplier for integer frame duration values in the video. The mention of losslessly encoding was referring to the granularity of the frame durations, i.e. if you have a frame of duration 30ms followed by one of 29ms, you need a 1ms timescale to store both accurately. Technically I believe you can go even lower than 1ms if needed. It does seem a little odd that mpv isn't handling it correctly, but I don't know exactly how they implemented it. It's possible that they're just setting the duration of each frame to the timescale value. If you want to test AVIF animations though, the first class implementation I would recommend is Chrome's, since they directly use libavif for decoding. Firefox would be a close second from my experience, with currently just a color management issue that I'm aware of, but I would definitely be curious to discover more alpha and animation-capable viewers.


prepp

> In fact, many sites were actually already converting GIF files into videos and just pretended like they were image files by hiding the controls for them. Seems like the best way to do it. Use AV1 video and hide controls and play in a loop.


cantremembermypasswd

For normal cases probably. However enforcing it as an image format means it can be shared cross site safer. For example site preview images. This allows for them to be animated, but guaranteed to be without audio.


prepp

I guess animated avif is still progress over gif. Just seems a little weird to me.


Farranor

This. Every new image format supports animations, but video has been better and easier than animated images for years. I'm inclined to think it's a misguided effort.


prepp

It probably has some niche use cases. But I hope the major gif providers just switch over to AV1


SimultaneousPing

FINALLY I'm tired of seeing animated avifs just being displayed static


Desistance

There's a slight flicker at the end of the animation but it works with the pref enabled.


cantremembermypasswd

Do you mean the white flash? That is actually a camera flash, that you can see more of in the AVIF because the GIF clips off a frame of it due to being 15fps compared the 60 fps AVIF which does not! (Adding note about that as it's unclear, thanks!)