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.

1
  • 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. Commented Dec 15, 2016 at 10:45

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.