I would like to convert an animated WebP file to a WebM. However, most tools only support converting to an animated WebP but not back, when they support animated WebPs at all: ImageMagick's convert
does not support animated WebP, ffmpeg
does not support animated WebP, and webpmux
only supports extracting a single frame at a time (as far as I can tell).
How can I go about making that conversion?
Since there does not appear to be any widely-supported way to do it yet:
anim_dump
example utility from libwebp, since it is not included in thewebp
package.git clone https://chromium.googlesource.com/webm/libwebp && cd libwebp
.make
to buildanim_dump
:echo "bin_PROGRAMS += anim_dump" >> examples/Makefile.am
../autogen.sh && ./configure && make && sudo make install
./usr/local/lib
to your linker path:echo "/usr/local/lib" |
sudo tee -a /etc/ld.so.conf
&& sudo ldconfig
. Without this,anim_dump
will not run.anim_dump
.mkdir frames && cd frames && anim_dump ../example.webp && cd ..
.webpmux
:webpmux -info ../example.webp
. Use about the average duration of the WebP frames as your WebM framerate. If your WebP does not use a consistent framerate, you'll have to manually deal with the durations somehow.ffmpeg -framerate <my-framerate> -i frames/dump_%04d.png example.webm
rm -r frames/
.