使用 Flash 保存从网络摄像头捕获的视频 [英] Save video captured from webcam using Flash

查看:36
本文介绍了使用 Flash 保存从网络摄像头捕获的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 Flash 从用户的网络摄像头捕获视频,然后将其保存在托管 Flash 文件的同一台服务器上.Web 服务器将运行 ASP.Net 技术.看起来很简单吧?

I'd like to use Flash to capure video from the user's webcam and then save it on the same server that hosts the Flash file. The web server will be running ASP.Net technology. Seems easy, right?

大量搜索产生了相同的代码行,以使用 Flash 开始网络摄像头捕获.我找不到任何将捕获的视频发送回服务器的内容.

Lot of searches yielded the same lines of code to start a webcam capture using Flash. I can't find anything that sends that captured video back to a server.

我可以找到很多博客和论坛帖子,暗示需要 3rd 方软件或 Flash Communication Server 才能在服务器上收集它,但我不明白为什么.

I can find lots of blog and forum posts that imply 3rd party software or Flash Communication Server is required to collect it on the server, but I don't understand why.

似乎 Flash 应该能够捕获一些视频并将其作为 HTTP 帖子发送到托管 Flash 文件的同一台服务器.这是非常基本的 Flash/网络摄像头功能,对吧?看来我们还不需要引入第 3 方依赖项.

It seems like Flash ought to be able to capture some video and send it as an HTTP post to the same server that hosts the Flash file. That's pretty basic Flash/webcam functionality, right? It seems like we don't need to introduce 3rd party dependencies just yet.

有人知道这些额外的示例 ActionScript 代码行可能隐藏在哪里吗?

Does anyone know where these extra lines of sample ActionScript code might be hiding?

推荐答案

您确实需要一个 Flash Media Server(或一个开源替代方案,例如 Red5)才能流式传输来自客户端到服务器,这本质上就是您要在这里执行的操作.使用 HTTP POST 无法做到这一点.

You do need a Flash Media Server (or an open-source alternative such as Red5) to be able to stream video from the client to the server, which is essentially what you want to do here. There is no way to do that using HTTP POST.

但是,您可以将视频显示对象绘制到每一帧的位图,并使用常规 HTTP 文件上传即时上传这些位图.尽管您可以想象,从性能的角度来看,这并不完全理想.您还会遇到问题,因为 Flash Player 安全模型不允许您在没有用户启动的操作的情况下上传文件(即鼠标单击事件在堆栈跟踪中.)不过,有一些方法可以解决此问题,例如通过 AMF 服务将文件作为 AMF ByteArray 发送,但这可能不是未来的证明.

You can, however, draw your Video display object to a bitmap each frame, and upload those bitmaps on the fly using regular HTTP file uploads. Although as you can imagine, that's not exactly ideal from a performance point of view. You'll also bump into problems because the Flash Player security model does not allow you to upload files without the operation being user-initiated (i.e. a mouse click event is in the stack trace.) There are way to work around this though, e.g. sending the file as an AMF ByteArray through an AMF service, but it might not be future proof.

最后,对于任何类型的专业级应用程序,您肯定希望合并 Flash Media Server(或 Red5).您可以从一些公司租用此类服务​​,例如 Influxis.沿着这条路线走下去,您将不必自己托管服务器(即 Java).

In the end though, for any type of professional-grade application, you'll definitely want to incorporate a Flash Media Server (or Red5.) There are companies from which you can hire such services, one example being Influxis. Going down that route, you won't have to host the server (which is Java) yourself.

这篇关于使用 Flash 保存从网络摄像头捕获的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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