python - matplotlib动画可以保存成什么格式?

标签 python animation matplotlib codec

我一直在学习matplotlib的动画包,而且所有的例子似乎都将文件保存为.mp4documentation没有提及任何其他特定格式。 matplotlib 是否可以使用其他文件格式来保存动画?如果有,它们是什么?

最佳答案

这取决于 .save() methodwriter 参数:

writer is either an instance of MovieWriter or a string key that identifies a class to use, such as ‘ffmpeg’ or ‘mencoder’. If nothing is passed, the value of the rcparam animation.writer is used.

Matplotlib 使用外部进程(您需要安装)来连接框架。例如,如果您使用的是 'ffmpeg',您可以找到支持的格式/编解码器:

ffmpeg -formats
ffmpeg -codecs

在 list 中,您会看到一些编解码器标有 E,表示此格式支持编码。

关于python - matplotlib动画可以保存成什么格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22571044/

相关文章:

python - 使用 Python 从电子邮件中提取文本

python - os.listdir() 使用什么方法获取目录中的文件列表?

python - 将 dict 应用到 ndarray 的快速(非循环)方法是什么(意味着使用元素作为键并替换为值)

objective-c - 试图用 UIRotation 手势 Controller 模拟动量/惯性

python - 气泡图标题和颜色

python - 需要建议使用 python 脚本从 ssh 服务器获取 git 克隆工作

android - 从底部动画 RecyclerView 添加

javascript - 将 div 元素中的文本与 Raphael SVG 元素一起制作动画

python - 绘图后更改轴

python - 在 matplotlib 轴/图上绘图 : get yticklabel individual position and use it for drawlines