首页 > 解决方案 > 如何使用 ffmpeg-python 创建 Webm 动画图像

问题描述

我使用以下代码和 ffmpeg 成功地从视频文件创建了一个 3 秒长/每秒 6 帧的动画图像文件:

ffmpeg.input(video_url, ss=0).filter('scale', motion_width, -1)
.filter('fps', fps=6, round='up')
.output(out_filesystem_motion_filename, vframes=18, loop=0)
.overwrite_output().run()

当我将输出文件名提供为 gif 时,这很好用:“thumbnail.gif”,但是当我将输出文件名提供为 webm 文件“thumbnail.webm”时,chrome 将输出文件作为视频而不是动画图像文件播放。

如何让 Chrome 将 webm 文件显示为动画图像?

标签: pythonffmpeganimated-gifwebm

解决方案


推荐阅读