将HTML5画布序列转换为视频文件 [英] Convert HTML5 Canvas Sequence to a Video File

查看:535
本文介绍了将HTML5画布序列转换为视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将HTML5 canvas中的动画转换为可上传到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?

推荐答案

声称使用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(也许新的歌剧,但我还没有检查)。这意味着您不能在其他浏览器中编码,除非您找到一种方法来编码您想要用作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画布序列转换为视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆