如何在服务器端将javascript动画转换为视频? [英] How to convert a javascript animation to video on the server-side?

查看:66
本文介绍了如何在服务器端将javascript动画转换为视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很确定这可能不是一件容易的事,但是这里有:



我的团队正在创建一个网站,用户可以在其中创建动画。我们正在使用js + html。问题是,现在客户希望我们能够将视频发送到YouTube,因此要求我们以某种方式将动画转换为服务器端的视频...



你们对于如何做到这一点有什么想法吗?

I am pretty sure this might not be an easy task, but here goes:

My team is creating a website where the user is able to create animations. We are using js+html. The thing is that now the client wants us to be able to send the video to YouTube, thus requiring us to convert the animation to video on the server-side somehow...

Do you guys have any ideas on how to do that?

推荐答案

没有神奇的,开箱即用的解决方案......你会努力工作...

基于动画的实际技术(CSS,JavaScript ......),你必须找到一种逐帧渲染动画的方法(你可以为你设置每秒帧数。之后,您可以将每个帧作为图像发送到服务器并将其收集到视频中(这可能是最简单的部分)...

您没有告诉您如何创建动画,但是你通过为您选择最好的JavaScript动画库,可能会让您的生活更轻松......(一个好处是 Paper.js [ ^ ])...

对于自制的JavaScript动画,您可以使用 requestAnimationFrame [ ^ ]获取帧的方法...
There is no magical, out-of-the-box solution...You will to have do the hard work...
Based on the actual technique of your animation (CSS, JavaScript...) you have to find a way to render that animation frame-by-frame (you can set the frames per second for you). After that you can send every frame to the server as an image and collect them into a video (that's probably the easy part)...
You didn't told how you create your animation, but you probably can make your life easier by choosing the best JavaScript animation library for you...(one good is Paper.js[^])...
For home-made JavaScript animations you may use requestAnimationFrame[^] method to get frames...


这篇关于如何在服务器端将javascript动画转换为视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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