From Holoctober day 7 (police).

I spent FOUR HOURS trying to make something that would both embed for easy viewing and play as intended (e.g., looping, has thumbnail) and failed so I guess DIRECT LINK IT IS (kill me).

  • MHLoppy@fedia.ioOP
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    9 months ago

    My hell:

    Download file normally?
    You can’t, Pixiv is using an otherwise-unused format they call Ugoira: a combination of still images combined with a JSON file containing frame timings, packaged into ZIP files which are downloaded and decompressed on the fly and put onto a canvas element on the page. This makes it (more or less) impossible to download through normal means.

    Use a downloader
    So, I did use three or four. The best one gave me the raw images and the JSON file with all the frame timings. I recreated the timing 100% to spec AND IT DIDN’T PLAY BACK AT THE SAME SPEED AS THE ORIGINAL (???) I tried so many things to solve this and none of them worked. The best I could get was “close”. If that was the only problem then I’d have been content with that result but:

    Everything hates the animation
    I tried APNG, animated WebP, manually exporting to VP9/WebM, manually exporting to H.264/MP4, throwing it on Fedia (kbin), throwing it on lemmy, throwing it on catbox, throwing it on Imgur. Literally every upload option I tried had at least one problem PLUS EVERY OPTION STILL DOESN’T PLAY AT THE SAME SPEED AS THE ORIGINAL EVEN WHEN USING THE ORIGINAL FRAME TIMINGS GUH.

    Hey, maybe you should you go outside and touch some gr-
    NO GRASS ONLY FANART

    • AnonTwo@kbin.social
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      Unfortunately I think Ugoira is very popular in Pixiv for it’s simplicity, but nobody has any desire to create a plugin for any image viewer.

      I think you’d have to intentionally add frames to any video format for the animation to properly go off.

      • MHLoppy@fedia.ioOP
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        9 months ago

        I think you’d have to intentionally add frames to any video format for the animation to properly go off.

        Yeah the choice (if using a video) is to either:

        • keep the animation to just one loop which keeps the file small… but videos don’t loop by default so that kind of sucks in terms of viewing experience orr
        • duplicate the animation cycle to play a few times, which makes the final size kinda large? (also not great for viewing)

        And then there’s the whole issue of videos generally not embedding as nicely as images X_X (PLUS THE GOD DAMN FRAME TIMING)


        Just because, here’s a couple of the files I had before giving up:
        Animated WebP, one cycle (?): https://files.catbox.moe/ugssep.webp
        H.264/MP4, one cycle (?): https://files.catbox.moe/r96kdv.mp4
        VP9/WebM, one cycle (?): https://i.imgur.com/THQ371h.gifv (but Imgur of course re-compresses to MP4)

        The Imgur gifv link is the best native viewing experience I could come up with since it’ll autoloop the underlying MP4 video, but that usually still requires the viewer to actually go to the page - not many people would see it as an embed option, and that kind of defeats the purpose of not just going directly to Pixiv.

        The animated WebP was supposed to be a good option, but kbin doesn’t seem to support it as an embed, and although Lemmy does, both times I tried uploading it to Lemmy directly the thumbnail for the image got messed up (although the image itself was okay). I could use catbox to link the WebP directly (and avoid the thumbnail issue), but catbox isn’t available in some regions so it locks out some viewers if using it :(

    • Lordran_Hollow@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 months ago

      I was just running into this problem as well. The artist’s Twitter has it in gif format, but Twitter wasn’t allowing me to download the gif like a normal photo, so I was stumped.