I've been learning matplotlib's animation package, and all of the examples seem to save the file as .mp4
. The documentation doesn't mention any other specific formats. Are there other file formats that matplotlib can use to save the animation? If so, what are they?
That depends on the writer
argument of the .save()
method:
writer is either an instance of MovieWriter or a string key that identifies a class to use, such as ‘ffmpeg’ or ‘mencoder’. If nothing is passed, the value of the rcparam animation.writer is used.
Matplotlib uses an external process(that you need to have installed) to join the frames. If you are using for example 'ffmpeg'
you can find the supported format/codecs with:
ffmpeg -formats
ffmpeg -codecs
In the listing you will see that some codecs are marked with an E meaning encoding is supported in this format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With