how can I set the resolution of an animation saved as mp4 movie with \"matplotlib.animation\" module?
On the web I only found examples using \"animation.FuncAnimation\".
You can control the resolution in a round-about way. The resolution, figure size, and dpi are not all independent, if you know two of them, then the third is fixed.
You can set the dpi
in the save argument, and before you save it, set the size of the figure with
fig.set_size_inches(w_in_inches, h_in_inches, True).
Your resolution is then dpi * w_in_inches X dpi * h_in_inches
.
dpi = 100
writer = animation.writers['ffmpeg'](fps=30)
ani.save('test.mp4',writer=writer,dpi=dpi)
You may need do upgrade to a newer version of mpl (debian is great because it is so conservative and awful because it is so conservative) from source.
bitrate
is the parameter used to specify the quality of a movie. The higher the value you set it to, the higher the quality of the movie will be.