Open alexwlchan opened 2 months ago
I had an initial attempt at this in #10, but it turns out the ffmpeg command for creating MP4 videos from animated GIFs doesn't work for animated WebP (at least, not yet).
There's a suggestion in this Reddit thread that I extract the frames and then feed them into ffmpeg
– the issue is that ffmpeg
doesn't have a WebP decoder, but I have one in the image crate: https://www.reddit.com/r/ffmpeg/comments/14xqbia/convert_animated_webp_to_mp4/
What I can't work out is whether I can get the timing information that way.
Also it turns out there's a method called is_animated()
which I should probably use instead of inspecting the frames directly: https://docs.rs/image/0.25.2/image/codecs/webp/struct.WebPDecoder.html#method.has_animation
There's another crate with WebP support using a C library, and it exposes the timestamp of individual frames: https://docs.rs/webp-animation/latest/webp_animation/struct.Frame.html#method.timestamp
For when I get round to this: here's an example of an animated WebP I can use for testing.
Prompted by discovering one such image in my collection.
This isn't widespread yet so it's not a priority, but it'd be nice.