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 画布序列转换为视频文件


基础教程推荐
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01