Skip to content Skip to sidebar Skip to footer

Can I Save A Matplotlib Animation To Webm Format?

I am using this example code as a test case: https://matplotlib.org/examples/animation/moviewriter.html In this code, they use FFMPEG to write the matplotlib animation to an .mp4 v

Solution 1:

Make sure you have ffmpeg compiled with libvpx (run ffmpeg with no arguments and see if there's a --enable-libvpx in the output).

FFMpegWriter = manimation.writers['ffmpeg']
writer = FFMpegWriter(fps=15, codec='libvpx-vp9') # or libvpx-vp8

[...]

with writer.saving(fig, "writer_test.webm", 100):
    [...]

Post a Comment for "Can I Save A Matplotlib Animation To Webm Format?"