Hey :)
I would love to see support for .ugoira files (i. e. created via Nandaka/PixivUtil2)!
At least I couldn鈥檛 find anything regarding these on here, so here I go.
Essentially, these are ordinary .zips with moving information in a .js file.
A workaround would also be nice.
Relating: Nandaka/PixivUtil2/issues/69
Is there a sample?
But from the sound of it, this could be the worst video "format" I've ever encountered.
Can't you just export it to a normal format like APNG, GIF or WebM with the same exact PixivUtil2?
@wm4 @wiiaboo Just checked, you can export it to GIF and APNG.
While GIF is obviously not an option (because of massive quality loss), APNG does a bit better.
The downsides are mainly the long time it takes to convert and the big size. It鈥檚 sometimes even bigger than the GIF (not in this comparison).
Here a comparison (ugoira with 150 frames):

Time-wise, the GIF took 1:06 to convert, the APNG 10:50 (and my computer is not that bad).
Here鈥檚 a link to these.
I know this may sound a bit childish, but this honeyview player can play .ugoira as well (at least that鈥檚 what Nandaka claims). So I鈥檇 assume, it鈥檚 not impossible to do :)
Not impossible, but that's an image viewer, mpv is not. Adding a pseudo-format only used by a single utility to export a pseudo-format only used by one site seems like the most niche usecase you can find.
You could find a way to script this to the edl protocol if only that .js/.json information was outside the zip.
Otherwise, it'd need to be a new demuxer inside FFmpeg/mpv specific to this pseudo-format.
The link to the samples doesn't work, btw.
Honestly, you might be better off writing a remuxer that just converts it to some container with MJPEG and VFR support.
(disclaimer: I designed the original ugoira format)
Or just use mf:// if the delay values are all the same.
The source images are probably either png or jpg - png can go into APNG, jpg could go into mkv as mjpeg.
The images inside the zip are always PNG or JPEG.
Very specific implementations aside, does mpv support playback within a zip archive? That could be generically useful perhaps (not just ugoira, e.g. Android boot animations, or just slideshows in a zip). Not sure if implementation-wise it would be easy to add though.
With --enable-libarchive, yes.
I found at least one simple python script that uses ffmpeg to remux it into mkv losslessly.
mpv with libarchive can open zip files - it basically treats them as playlists, with special mangled archive paths as entries. But it can't use it for mf:// or --merge-files, so you can make it only treat them as separate images. EDL doesn't work with it either, due to questionable "security" mechanisms.
(Using EDL/--merge-files wouldn't be so great anyway, because it keeps all files open, including various buffers, which would result in quite a lot of bloat.)
That鈥檚 a nice script you found, @wiiaboo! From what I can see, it even uses the embedded json data.
So, to sum it up: the best way to view these animations is probably by remuxing them into a .mkv.
I also agree that this seems to be a very niche format and that it鈥檚 mainly build for online viewing.
But that support for .zips is given is also a nice thing to note, even if I鈥檓 unable to install libarchive (it gives me some strange error).
On a side note, I鈥檇 suggest putting a list with all formats mpv currently supports (with build flags if necessary) somewhere in the manual (I even searched for zip before I opened this issue).
Thanks for the help everyone!
What does the script do if the source files are png?
Probably fail, but it could be adapted to use mp4 for png instead, according to @marcan.
Well, in theory, you can use png in mkv via VfW muxing. Very evil. (Reminder: VfW muxing is AVI compatibility in mkv.)
I tried muxing a mkv with png. FFmpeg actually refuses to remux apng to mkv, but png works (which means you'd need to write an awkward ffconcat file to put in multiple png files). mpv's demuxer eats this, and vlc seems to work too. Didn't actually try multiple frames.