3 ms·
Oh please no. Why would you ever do this? Please use the <video> tag to embed your actual video with a GIF fallback if you wish. Why are we using an ancient 8-b
by dheera 6y ago
Oh please no. Why would you ever do this? Please use the <video> tag to embed your actual video with a GIF fallback if you wish. Why are we using an ancient 8-bit lossless format for video when pretty much all browsers support video embeds these days?
<video width="320" height="240" autoplay loop playsinline muted>
<source src="foo.mp4" type="video/mp4">
<source src="foo.ogg" type="video/ogg">
<!-- GIF fallback for ancient browsers but it's 2021 and you probably don't need this anymore -->
<img src="foo.gif" width="320" height="240">
</video>
With H.264 or any modern codec you'll get 24-bit color and smaller file sizes than GIF. It's better in every way I can imagine.
- sp332 6y agoAgreed. I think people see little video clips and think "oh, a GIF" without realizing that imgur, giphy, etc. don't actually use GIFs.
- superdisk 6y agoGIFs are nice for short looping clips, because they can be embedded anywhere and they don't glitch out unexpectedly like every single "using videos as gifs" solution out there.
- xvilka 6y agoAnimated WebPs also can do that but significantly better. And they are supported by all browsers now.
- dec0dedab0de 6y agoWill the file autoplay and loop according to the same rules everywhere I view it after I right-click and save it? Because that is what people liked about animated gifs. It's like you're telling people to drive a car instead of riding a bike. They have some crossover in functionality but they're not the same thing.
- dheera 6y agoWell yeah except GIF isn't a good bike at all, it's a beaten-up Huffy with a rusty chain, worn-down brake pads, leaky tire, and a torn-up seat.
- jjcm 6y ago> Why would you ever do this? There are still situations where you want a gif. Your approach works fine if you're writing your own code, but if I want to embed a looping animation on a Confluence page, it isn't a viable option.
- scpedicini 6y agoThe articles end goal is not animated GIF files for the sole purpose of putting them on websites. Whether you like it or not, there are still plenty of scenarios where using a GIF file is necessary, Evernote for example only supports embedding animated GIFs not webm or any kind of proper video codec.