• anguo@piefed.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    12 minutes 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.

  • chunes@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    7 hours ago

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

    Get mad at ffmpeg for trash defaults.

  • Ilumar@lemmy.zip
    link
    fedilink
    English
    arrow-up
    73
    ·
    edit-2
    18 hours 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.

    • ben@lemmy.zip
      cake
      link
      fedilink
      English
      arrow-up
      42
      ·
      17 hours ago

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

      • Glitchvid@lemmy.world
        link
        fedilink
        English
        arrow-up
        24
        ·
        edit-2
        10 hours 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.

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

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

            e: fixed by using an aliased domain.

        • toothbrush@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          17
          ·
          15 hours 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”)

        • ink@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          14 hours 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
            15 hours 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
              2
              ·
              4 hours 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
              14 hours 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
                14 hours 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.

    • NauticalNoodle@lemmy.ml
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      11 hours ago

      “…massive files…”

      I thought the file size was part of the format specification, no?

    • Victor@lemmy.world
      link
      fedilink
      English
      arrow-up
      9
      ·
      18 hours 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?

    • Noja@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      17
      ·
      15 hours ago

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

  • perishthethought@piefed.social
    link
    fedilink
    English
    arrow-up
    25
    ·
    18 hours 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.

    • tal@lemmy.today
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      7 hours 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”.

  • magnue@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    18 hours ago

    I always liked to use Photoshop with the ‘save for web (legacy)’ export. Gives you a handy preview of how big it will be and lots of options.