【发布时间】:2016-09-22 00:37:59
【问题描述】:
我是 Python 动画的新手,我正在尝试按照本教程保存一个:
https://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/
除了保存部分,一切正常:
# 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'])
我从这里下载并提取了 Mencoder: http://www.videohelp.com/software/MPlayer
但不知道现在该做什么。我在网上查看,但无法找到从下载软件到在 Python 中调用它的分步说明。我正在使用 64 位 Windows 10。任何帮助将不胜感激。
【问题讨论】:
-
听起来您找到了解决方案,但我认为您需要将
writer='mencoder'添加到save()参数中,并且可能删除extra_args,因为它们是用于 ffmpeg 的。
标签: python animation matplotlib