Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Will 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.


Well 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.


The 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.


> 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.


GIFs 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.


Animated WebPs also can do that but significantly better. And they are supported by all browsers now.


Agreed. I think people see little video clips and think "oh, a GIF" without realizing that imgur, giphy, etc. don't actually use GIFs.


While they might not know the specific term, they do know that something is different with those services b.c. they can’t save the ‘gif’ videos as easily as they can with real gifs.


Also, twitter and Facebbok convert uploaded GIFs to video.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: