Live data from Hacker News

It's time to replace GIFs with AV1 video

singhkays.com

91–100 of 327 posts

Re: It's time to replace GIFs with AV1 video

#91

GIFs take up a massive amount of space (often multiple megabytes!) and if you’re a web developer, then that’s completely against your ethos! Judging by most websites I comes across, this must be referring to some other universe.

They usually just blame marketing and wash their hands of the finished product.

Re: It's time to replace GIFs with AV1 video

#93
post #45
post #34

Earlier quoted context omitted.

1. One of the reasons a kinda secondary feature of GIFs (animations) became so popular is because it's so easy to generate them. 2. A big feature is that they are not lossy compressed so you can do animations of all the kinds. 3. They allow to set very slow FPS settings in a trivial way. Animated GIFs are not really a video format, they are just a set of non-lossy compressed images shown at a timer interval. Such sma…

If you have an application where you need lossless and optionally low FPS, then GIF is fine (and APNG and webp for smaller filesizes but less compatibility). But the average GIF in the wild these days is a reencoding from a video that doesn't match this description, which is what should be changed to h264, vp8, vp9, or AV1.

Maybe the movement could and should clarify their goals for world domination do not include dancing baby gifs?

Re: It's time to replace GIFs with AV1 video

#94

Earlier quoted context omitted.

Animated gifs are compressed, and do require decoding. Hell, so do non-animated gifs. Since animation was added in the '90s, GIF is basically just a really inefficient (but extremely well-supported) video format. I agree that there won't be wide adoption of AV1s until it can transparently be interacted with just like gifs are now.

That is true. I suppose even jpegs are compressed and require decoding. I'm pretty sure it is orders of magnitude quicker than video decoding though. I can have 500 gifs playing at once just fine, but if I had 500 equivalently sized webm h264 videos playing my computer would have a stroke.

GIF is super slow to decode, more so than any modern video format!

It doesn't seem like it mostly because browsers (slowly) decode GIF as they (slowly) download it, and cache all uncompressed frames in RAM. They don't do the same for tag, because they assume it's only for high-res, non-looping video.

• GIF data is huge. 15x-20x times larger for the same dimensions & quality than normal video codecs, and sheer amount of bytes to chew through eclipses any savings from it being slightly simpler.

• GIF's compression doesn't support any parallelism. Frames have to be processed bit by bit, frame after frame. Your multi-core CPU can use only a fraction of its speed when decoding. OTOH modern formats support parallelism on all levels - frames, tiles within frames, blocks, transforms. Modern CPUs can process these very effectively.

• In modern systems RAM is ridiculously slow relative to computing power available on the CPU locally. However, GIF's LZW is based on lookups in a dynamic dictionary, so not only you have just one CPU core process it, the core mostly spends time chasing pointers.

• There's no hardware acceleration for GIF. For newer codecs it's quite common and very power-efficient.

There's no technical reason (other than legacy code) stopping browser vendors from treating AV1 just like GIF, with all looping glory. In fact, Safari already supports H.264 in ! It's faster in every way.

Re: It's time to replace GIFs with AV1 video

#95

The most important part of GIFs for me is that they behave like images in browsers. They are always auto-playing with no concept of play and pause. You can drag and drop them from a browser to your desktop to save them. You can save an entire page and have all the image files save with it. I've never had this work for webm or other video formats. You could even argue that GIFs not being a video with no video decoding…

> [...]but I can have 100+ GIFs playing at once with no impact to my CPU.

That's... not entirely accurate. What do you think is rendering all those gifs to screen?

Re: It's time to replace GIFs with AV1 video

#97
post #75

Earlier quoted context omitted.

... and it is a complete mess. They try to to decide which format you want based on your client. Thus if you hotlink an image directly you don't know anymore if it will load or even if the format the next guy will see has sound. I've linked "images" purely because of the sound and other viewers got a version without it. And many times it just won't load. This is supposed to be simple...

Some sites (looking at you, imgur) are really bad about that. Doing what this article recommends shouldn't cause those problems, though. The only notable risk is linking a format that mobile can't load.

Often you can just load the same url with .gif on the end and it will work, since they make many formats available with the same base filename.

Re: It's time to replace GIFs with AV1 video

#98
post #95

The most important part of GIFs for me is that they behave like images in browsers. They are always auto-playing with no concept of play and pause. You can drag and drop them from a browser to your desktop to save them. You can save an entire page and have all the image files save with it. I've never had this work for webm or other video formats. You could even argue that GIFs not being a video with no video decoding…

> [...]but I can have 100+ GIFs playing at once with no impact to my CPU. That's... not entirely accurate. What do you think is rendering all those gifs to screen?

The other seven cores that are not being identified as "my CPU".

Re: It's time to replace GIFs with AV1 video

#99
post #75

Earlier quoted context omitted.

... and it is a complete mess. They try to to decide which format you want based on your client. Thus if you hotlink an image directly you don't know anymore if it will load or even if the format the next guy will see has sound. I've linked "images" purely because of the sound and other viewers got a version without it. And many times it just won't load. This is supposed to be simple...

Some sites (looking at you, imgur) are really bad about that. Doing what this article recommends shouldn't cause those problems, though. The only notable risk is linking a format that mobile can't load.

How is that not a complete dealbreaker though?

I as a user can't possibly be expected to know and deal with whatever the recipient of my link uses.

A magnitude or two of data and worse quality is a small price to pay for something that actually works and still loads in realtime, even on mobile, anyway.

Re: It's time to replace GIFs with AV1 video

#100
post #95

The most important part of GIFs for me is that they behave like images in browsers. They are always auto-playing with no concept of play and pause. You can drag and drop them from a browser to your desktop to save them. You can save an entire page and have all the image files save with it. I've never had this work for webm or other video formats. You could even argue that GIFs not being a video with no video decoding…

> [...]but I can have 100+ GIFs playing at once with no impact to my CPU. That's... not entirely accurate. What do you think is rendering all those gifs to screen?

No "major" impact to the CPU. As insignificant as displaying however many frames exist in the gif as still frame jpegs at the same time.
Post reply on HN