• anguo@piefed.ca
    link
    fedilink
    English
    arrow-up
    58
    ·
    1 day ago

    Most people do this:

    ffmpeg -i video.mp4 output.gif

    …no, most people have never heard of ffmpeg and throw it in an online converter.

  • IronKrill@lemmy.ca
    link
    fedilink
    English
    arrow-up
    13
    ·
    1 day ago

    As much as everyone likes to trash on it, this is part of what webp is for. Animated, loopable images at super small sizes that display on just about anything that runs a browser.

  • Ilumar@lemmy.zip
    link
    fedilink
    English
    arrow-up
    96
    ·
    edit-2
    2 days ago

    Please stop making gifs at all. It’s a terrible format that creates massive files that look like shit.

    Webm is supported almost everywhere now and manages better quality at higher framerates and smaller file sizes.

    • brucethemoose@lemmy.world
      link
      fedilink
      English
      arrow-up
      14
      ·
      edit-2
      23 hours ago

      I’ve honestly given up on support of new formats.

      Here we are, 2026, and brand new software like Lemmy:

      • Doesn’t support AVIF

      • Doesn’t support JXL

      • Doesn’t support WebP

      • Won’t upload short, small videos either.

      Meanwhile:

      • Many clients won’t play animated WebP

      • Most clients won’t play APNG

      • Many won’t load AVIF

      • Basically only Apple/Safari will load JXL

      • VP8/VP9/AV1 support in video isn’t universal

      What am I supposed to do?

      I used to send support requests over this, but I’ve given up. We are going to be stuck with SDR JPEGs and blocky GIFs forever, especially since media format literacy seems to be globally.

      • Glitchvid@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        21 hours ago

        What am I supposed to do?

        You decide what to target, and work with what you have. That’s how it’s always been with web technology.

        If you need to support the barest minimal possible clients then you might not even have HTML5. Otherwise, if you have HTML5 you can use the source tag to provide clients with a choice of formats/encodings and they can pick the one they support. If the clients can’t even mange that, well, things on the internet have always been broken anyway.

        And somebody’s gotta start somewhere, WebP was shoved down everyones’ throats and now it’s supported very broadly, as AVIF pick up users software devs will take notice and start supporting it.

        • brucethemoose@lemmy.world
          link
          fedilink
          English
          arrow-up
          5
          ·
          edit-2
          20 hours ago

          Will they, though?

          I cite Lemmy again. This is supposed to be a newer, better version of Reddit, basically, but I can’t even upload a WebP to my instance… when are they supposed to adopt AVIF?

          If I try to host externally, which is more of a pain, very few image hosts will take an AVIF. Not a single one I found except catbox will take a JXL.

          Where’s the pressure? Who’s making these files and trying to use them? Even my phone converts uploaded JXL and HEIF files to SDR JPEGs upon upload, since it rightfully assumes nothing will work with them.

          I hate to sound so cynical, but I had your mindset a while back. And outside Apple, precisely nothing has changed. Its gotten more dramatic, if anything, since HDR support is now basically DOA too.

          • Glitchvid@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            20 hours ago

            Where’s the pressure? Who’s making these files and trying to use them?

            The standards bodies and the companies that pay their bills. That’s Netflix, Google, et al. All have a vested interest in good multimedia support in browsers. It’s why browsers have shockingly good support actually, most of the problems are downstream on clients and implementations that don’t know or care to enable these newer formats.

    • Zarobi@quokk.au
      link
      fedilink
      English
      arrow-up
      9
      ·
      edit-2
      1 day ago

      I used to love optimising images in gif format. I would make like 4–30kb memes and animations for my friends in Photoshop CS2. It’s actually extremely efficient and lightweight if you do it right… You have cool tools like transparency between frames and unbroken colour blocks don’t take any additional storage space. There’s nothing wrong with gif.

      The problem is how people use them. We take a live action video file and shove it through an automated converter tool that doesn’t give a shit about efficiency and will do a complete repaint between frames and use 256+ colour palette. Then you end up with an ugly dithered overcooked piece of shit 50mb 10 second animation. Gif was not designed for this…

      • Ilumar@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        Discord, Signal and Whatsapp all let you send any video format I’ve ever tried. I presume the same is true for Messenger and whatever else people use to communicate nowadays. I genuinely can’t think of anything that would support GIF but not various video formats.

        • Encrypt-Keeper@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          ·
          1 day ago

          That works out if you’re from Europe or somewhere else where using third party messaging apps is common but in the US we primarily use text messaging apps which don’t really support webm or avif

    • ben@lemmy.zip
      link
      fedilink
      English
      arrow-up
      59
      ·
      2 days ago

      Counterpoint: GIFs loop by default in basically every app, WEBM doesn’t

      • Glitchvid@lemmy.world
        link
        fedilink
        English
        arrow-up
        35
        ·
        edit-2
        2 days ago

        Can just use avif instead, it holds an AV1 stream and acts like gifs/images do WRT looping — also very broad support (more than AV1 in WebM containers).

        Demonstration:

        Image

        Edit: switched to an example with simpler decode requirements.

        • walden@wetshav.ing
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 hours ago

          Thanks for bringing this format to my attention. I opened it in a browser and it’s pretty sweet.

          Hopefully app support will grown over time… Otherwise it’ll be .gif 'till the end.

        • ben@lemmy.zip
          link
          fedilink
          English
          arrow-up
          1
          ·
          20 hours ago

          Does not work on Voyager for Android, the humble inefficient GIF continues in spite of more efficient options

        • toothbrush@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          31
          ·
          2 days ago

          Your demonstration is a sluggishly loading static image on my end, so I guess support isnt that widespread :P

          (Im using the app “Summit”)

          • Glitchvid@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            edit-2
            1 day ago

            That’s caused by bad regex in the app, it’s getting confused about domains.

            e: attempted fix by using an aliased domain.

          • Eldritch@piefed.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 day ago

            I do regularly. However apple users are largely the bane of this. Apple’s support for things can be very slow and spotty. As long as you keep it extremely old and basic. Say h264 they’ll be able to see. A lot of apple mobile devices could support h265 but apple doesn’t. My last couple of mobile devices have supported it for nearly a decade. But apple enabling it on their mobile hardware hasn’t been anywhere near that long. Apple will hopefully have AV1 support common by the time AV3 is released and AV2 widely supported by the 2030s.

              • Eldritch@piefed.world
                link
                fedilink
                English
                arrow-up
                1
                ·
                1 day ago

                Oh yes with respect to Avif you are correct. I was more referring to multimedia messages in general. But you are correct about Avif. That format in particular is not well supported a lot of places. I know Linux is probably one of the few areas it sees much. Windows is a much different story and I’m sure Apple desktops as well.

        • ink@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          4
          ·
          edit-2
          2 days ago

          (on Arctic on ios) the uploaded image displays as a static image for me. Even clicking on it and waiting, it doesn’t seem to animate :T

          Edit: I checked again through the Voyager app, and it did indeed load, though it took around 45-60 seconds* for it to get through the entire animation before it started looping again, albeit at the same speed as the first playthrough.

          I chalked it up to the outdated hardware, as you mentioned in your reply. Cheers! :)

          • Glitchvid@lemmy.world
            link
            fedilink
            English
            arrow-up
            6
            ·
            edit-2
            2 days ago

            Apple has limited support for AV1 streams (yes, even for software decode) unless on very recent hardware. Here’s an AV1 stream inside a webm container for comparison, would be interesting to see if that works over the avif container on your stack.

            • boonhet@sopuli.xyz
              link
              fedilink
              English
              arrow-up
              3
              ·
              1 day ago

              This doesn’t work for me but the original one you posted does (Voyager, iPhone 14 pro)

            • ink@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              2 days ago

              Ah yeah, that would explain it - my phone is now pretty outdated (I’m on a 12) - I clicked on the image link in your response but it didn’t load for me, unfortunately.

              I’m not sure if that’s a result of my outdated hardware or if I perhaps clicked on it before it had a chance to process your upload, but you seem much more knowledgeable than I, so I’m going to assume it’s my hardware. I appreciate the response and the second attempt, though! :)

              • Glitchvid@lemmy.world
                link
                fedilink
                English
                arrow-up
                2
                ·
                edit-2
                2 days ago

                It’s an intentional behavior by Apple. Basically they just don’t support AV1 videostreams unless the hardware you’re using has a hardware decoder (read: very new). They could support it using software decode (what browsers typically do for AV1 inside avif containers) but… for whatever reasons don’t.

          • Noxy@pawb.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            17 hours ago

            my lemmy client doesn’t support opening arbitrary web pages

            which is my entire point: your proposal is dead in the water as it doesn’t work universally.

            • ohshit604@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              2
              ·
              edit-2
              16 hours ago

              I would argue and say that it is poor implementation on your developers behalf, Lemmy itself supports it, your client is failing to properly render the image.

              As mentioned, previously Voyager displays the image as intended.

      • Ilumar@lemmy.zip
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        I wasn’t even aware of APNG or AVIF before this thread. Webm was just the first alternative for GIFs that came to mind.

        Looking at this APNG also seems to result in pretty large files whereas AVIF appears to have by far the best compression.

        AVIF looks like the best alternative for sending short meme clips to people, which I assume is most peoples use case for GIFs.

    • Victor@lemmy.world
      link
      fedilink
      English
      arrow-up
      10
      ·
      2 days ago

      Webm is supported almost everywhere now and manages better quality at higher framerates and smaller file sizes.

      Anybody who has compared animated WebM vs animated JPEG XL?

      • Eldritch@piefed.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        Sadly no. Most browsers don’t render static JXL by default yet. Let alone animated. I wish they would. Though for most things regular video transport streams will usually be as good or better. Honestly at this point animated image formats really are kind of a niche and not necessarily super useful at this point. Apng for instance when it was created nearly 20 years ago made some sense. Today now that it’s finally getting supported it doesn’t make as much sense.

        • Victor@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 day ago

          I mean, we don’t really need a browser to render it in order to make a performance comparison. But hey, Firefox is getting support for JPEG XL? So there’s that, I guess.

    • Noja@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      21
      ·
      2 days ago

      the same file without visual quality loss could be a 156.79 KiB webp file, saving energy, internet, and storage costs

  • chunes@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    2 days ago

    Don’t get mad at people for using logical command line switches.

    Get mad at ffmpeg for trash defaults.

  • perishthethought@piefed.social
    link
    fedilink
    English
    arrow-up
    26
    ·
    2 days ago

    I just tested this with a 8-second, 35MB mp4 video.

    The “don’t do this” command made a crappy looking 316MB gif.

    The suggested pair of commands, using the palette file, made a 57MB very nice looking gif.

    Seems legit to me but I’m not, as you say, an expert.

    • genzboomer@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 day ago

      I am guessing the width and height of the video file are quite large. If you plop it down to a size suitable for gif, say maybe 400px width, you’ll see a massive drop in filesize.

    • tal@lemmy.today
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 days ago

      I mean, it’s still going to have the pants beaten off it by WebM or AVIF for anything originating from a video camera.

      GIF was just never intended to be a video format. I have a hard time thinking of something where it’s really competitive. Maybe if you had a recorded lossless video of a small-palette video game, like, NES era or earlier, then GIF might be a solid choice. I’d still think that APNG or MNG would probably outperform it.

      GIF animations really only got a boost because there was a period of time when it was all that a decent variety of Web browsers could display.

      EDIT: Also, if one is using GIF…I dunno if ffmpeg does this by default, but most video formats have I-frames and then frames that depend on those. When seeking, a player will seek to the nearest prior I-frame and then decode from there.

      I don’t believe that GIF 89a has a formal concept of I-frames, because the format was never intended for real video. But it is possible to create frames in a GIF 89a animation with transparent areas that don’t differ from the prior frame, and this achieves some of the efficiency benefits that a video format would get. I know that there have been GIF 89a conpressors that will do this. The downside is that it kills seekability, since after a seek in a player that just starts drawing from the current frame, you’ll see only some of an image until the next time that a pixel in a frame is non-transparent and gets redrawn. There may not be any frames wirhout transparent areas nearby, and the player has no way to know where to look for one. But for applications where you don’t care about seekability, that may help mitigate some of GIF’s limitations for animations.

      In all honesty, though, the right answer for video is almost always “use a newer format than GIF”.

  • squeeG@piefed.social
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 days ago

    ffmpeg <3 good info here, also give Gifsicle a look if you need help getting your gifs smaller