0

excuse me, but why python saving only part of animation as mpeg4, how to save the full animation? (this example from matplotlib library)

Please Visit https://matplotlib.org/gallery/animation/animate_decay.html

ani = animation.FuncAnimation(fig, run, data_gen, blit=False, interval=10, repeat=False, init_func=init)

#this is my line of code
ani.save('decay.mp4', fps=30, extra_args=['-vcodec', 'libx264'])

plt.show()
  • You need to give a clear problem description. This could be related to a recently introduced bug, see [this question](https://stackoverflow.com/questions/49183656/animation-freezes-after-a-number-of-frames-after-upgrading-matplotlib), but it could also be caused by something completely different. See [mcve]. – ImportanceOfBeingErnest Mar 09 '18 at 09:30

2 Answers2

0

I found to sloving of this problem.

I use this code:

ani = animation.FuncAnimation(fig, run, frames=data_gen, blit=False, interval=10, repeat=False, init_func=init, save_count=1000)

key to solve of my problem:

in FuncAinimation add a parameter

save_count=1000

and all works is fine!!!

Thanks all!

-1

You should try to install FFmpeg and set the environmental variables.This page "Save Matplotlib Animation" gives reference

David
  • 35
  • 11