0

I am new to Python animations and I'm trying to save one, following this tutorial:

https://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/

Everything works except the saving part:

# save the animation as an mp4.  This requires ffmpeg or mencoder to be
# installed.  The extra_args ensure that the x264 codec is used, so that
# the video can be embedded in html5.  You may need to adjust this for
# your system: for more information, see
# http://matplotlib.sourceforge.net/api/animation_api.html

anim.save('basic_animation.mp4', fps=30, extra_args=['-vcodec', 'libx264'])

I downloaded and extracted Mencoder from here: http://www.videohelp.com/software/MPlayer

but not sure what to do now. I looked online but was unable to find step-by-step instructions from downloading the software to calling it in Python. I am using 64-bit Windows 10. Any help would be much appreciated.

A B
  • 305
  • 2
  • 5
  • 13
  • It sounds like you found a solution, but I think you needed to add `writer='mencoder'` to the `save()` arguments, and probably remove the `extra_args`, since they are for ffmpeg. – Gabriel Dec 15 '16 at 10:45

1 Answers1

1

I figured it out.

I decided to use FFMPEG instead and downloaded this:

https://ffmpeg.zeranoe.com/builds/

and followed these instructions:

http://www.wikihow.com/Install-FFmpeg-on-Windows

Cannot save matplotlib animation with ffmpeg

Using FFmpeg and IPython

Community
  • 1
  • 1
A B
  • 305
  • 2
  • 5
  • 13