Convert HTML5 Canvas Sequence to a Video File(将 HTML5 画布序列转换为视频文件)
问题描述
我想将 HTML5 画布中的动画转换为可以上传到 YouTube 的视频文件.是否有任何类型的屏幕捕获 API 或可以让我以编程方式执行此操作的东西?
I'd like to convert an animation in HTML5 canvas to a video file that could be uploaded to YouTube. Is there any sort of screen capture API or something that could allow me to do this programatically?
推荐答案
有一个 whammy 库声称可以使用 JavaScript 从静止图像中生成 webm 视频:
http://antimatter15.com/wp/2012/08/whammy-a-real-time-javascript-webm-encoder/
There exist the whammy library which claims to produce webm videos from stills using JavaScript:
http://antimatter15.com/wp/2012/08/whammy-a-real-time-javascript-webm-encoder/
请注意,存在一些限制(正如预期的那样).这个编码器基于 webp 图像格式,目前只在 Chrome 中支持(也许新的 Opera 也是,但我没有检查).这意味着您不能在其他浏览器中进行编码,除非您首先找到一种方法来编码您想要用作 webp 图像的图像(请参阅 此链接 了解可能的解决方案.
Note that there are limitations (as to be expected). This encoder bases itself on the webp image format which is currently only supported in Chrome (perhaps the new Opera too but I haven't checked). This means you can't encode in other browsers unless you find a way to encode the image you want to use as a webp image first (see this link for possible solution for that).
除此之外,无法使用 JavaScript 从图像创建视频文件,也无法使用原生浏览器 API 从画布创建视频文件.
Beyond that there is no way to create a video file from images using JavaScript and canvas using native browser APIs.
这篇关于将 HTML5 画布序列转换为视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 HTML5 画布序列转换为视频文件


基础教程推荐
- fetch 是否支持原生多文件上传? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01