Live data from Hacker News

Serve Videos Instead of GIFs

dannyguo.com

61–70 of 242 posts

Re: Serve Videos Instead of GIFs

#61
post #5

Isn't this exactly what animated WebP [1] is supposed to address? [1]: https://en.wikipedia.org/wiki/WebP#Animation

Yes, and would Apple please support WebP in Safari as the only remaining holdout? Before we all just boycott Safari and go ahead and use WebP anyways.

boycott iOS? good luck...

Re: Serve Videos Instead of GIFs

#62
post #10

Serve videos as videos. Photo data compresses better with Jpeg. But gifs are still a better option for animated illustrated graphics.

Why is JPEG the de facto lossy compression format for photos? It always bugs me that video formats get something new every 5 or so years yet photos are in JPEGs for decades.

The past couple decades (really! see JPEG2000!) have seen fairly regular introductions of new lossy image formats, but JPEG continues to win due to:

1. widespread support

2. "good enough" compression

Formats that compress better, like HEIC and webp, are only ~2x better, have sparse software/hardware support, and are likely to be patent-encumbered.

If I had to guess, formats that support HDR or other features haven't seen adoption due to a lack of widespread display support (in the case of HDR) and a lack of user interest.

See https://en.wikipedia.org/wiki/Comparison_of_graphics_file_fo... for a bunch of examples.

Re: Serve Videos Instead of GIFs

#63

I already said that before and I'll do it again: it won't work until we make videos act like gifs, which act like images. The video per se won't loop if I save it in my computer or phone. I can't drag and drop, right click, long tap. To have anything replacing gif you need THE EXACT SAME BEHAVIOUR, EVERYWHERE. It doesn't matter for the consumer whose fault it is: encoding, the app, how the file is created. The user u…

I use a chrome-based browser, but because it's missing some component, probably due to stupid DRM crap, most videos on most sites don't play for me. However, some of them do work. I don't feel like I'm missing much. But GIFs are certainly way more usable than video. I'm also writing web-based forum designed for backwards compatibility with older browsers, so GIFs will always be the default for me.

Re: Serve Videos Instead of GIFs

#64

The ffmpeg command will default produce one that can only be decoded on Chrome. You should specify a codec supported by most browsers (`-c:v libx264`).

Thank you very much for posting that. I've been trying to figure out how to do that for a while.

Re: Serve Videos Instead of GIFs

#65
One important thing that was not mentioned in the article: gifs automatically play and are not easily stopped. Videos have more knobs on the client side to tweak whether it plays or not. If I use a gif, I know with great certainty that unless all images on the client are blocked they are going to see my animated content. There are tons of extensions and browser features out there that attempt to stop that feature from videos.

Re: Serve Videos Instead of GIFs

#66

Earlier quoted context omitted.

iOS has been slowly making HEIF more common. It’s just that it takes a long time for the entire tooling chain to support it.

HEIF is patent-encumbered and a non-starter.

HEIF is a container format and isn’t generally considered “patent-encumbered”. HEVC (which is one of several image formats supported inside HEIF) is probably what you’re referring too.

Re: Serve Videos Instead of GIFs

#67
post #10

Earlier quoted context omitted.

Why is JPEG the de facto lossy compression format for photos? It always bugs me that video formats get something new every 5 or so years yet photos are in JPEGs for decades.

iOS has been slowly making HEIF more common. It’s just that it takes a long time for the entire tooling chain to support it.

[deleted]

Re: Serve Videos Instead of GIFs

#69

If videos looped seamlessly I'd happily serve videos. Sadly, they do not.

They can, and they do. This article shows you an example at the end. What's the issue?

tried to drag and drop and didn't work. Also, if I save to share later, it's not going to work, and I would need to do the same things the author did to make it work. It's not guaranteed that it will work properly (with auto loop) everywhere. And if you consider browsers/extensions might block auto-playing videos in the future...

gif just works. Drag and drop anywhere, any browser, any app, and it works. (Ok, almost anywhere, but still way more accepted than video).

Re: Serve Videos Instead of GIFs

#70

The ffmpeg command will default produce one that can only be decoded on Chrome. You should specify a codec supported by most browsers (`-c:v libx264`).

Thank you very much for posting that. I've been trying to figure out how to do that for a while.

I've also learned that -pix_fmt yuv420p is necessary, changes the colorspace from RGB to YUV

The full git gist (not mine): https://gist.github.com/ingramchen/e2af352bf8b40bb88890fba4f...

Post reply on HN