在我的笔记本中,我从 URL 获取一些数据,执行一些分析并进行一些绘图。
我还想使用FuncAnimation
of创建一个 html 动画matplotlib.animation
。所以在序言中我做
import matplotlib.animation as manim
plt.rcParams["animation.html"] = "html5"
%matplotlib inline
(别的东西...... def init()...
,def animate(i)...
)然后
anima = manim.FuncAnimation(fig,
animate,
init_func=init,
frames=len(ypos)-d0,
interval=200,
repeat=False,
blit=True)
为了形象化,我然后打电话给
FFMpegWriter = manim.writers['ffmpeg']
writer = FFMpegWriter(fps=15)
link = anima.to_html5_video()
from IPython.core.display import display, HTML
display(HTML(link))
因为我希望剪辑在笔记本中显示为整洁的 html 视频
虽然这在我的机器上运行良好,但在 Watson-Studio 上我收到以下错误:
RuntimeError: Requested MovieWriter (ffmpeg) not available
我已经检查了它ffmpeg
以 Python 包的形式提供
(!pip freeze --isolated | grep ffmpeg
给ffmpeg-python==0.2.0
)
问题是:我怎么知道matplotlib.animation.writers
在 中使用编解码器ffmpeg-python
?
非常感谢所有响应者和支持者