javascript 用于网络摄像头视频捕获的 Red5 录像机和服务器的简单替代品?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5128899/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Simple alternatives to Red5 recorder and server for webcam video capture?
提问by jmw
I'm looking for a flash script/library to capture video and audio from a webcam and then somehow get a saved flv to my encoding server. I'm not looking for something that will host the videos for me. I just need something simple to capture and then upload. I really want this to be open source and free.
我正在寻找一个 flash 脚本/库来从网络摄像头捕获视频和音频,然后以某种方式将保存的 flv 保存到我的编码服务器。我不是在寻找可以为我托管视频的东西。我只需要一些简单的东西来捕捉然后上传。我真的希望这是开源和免费的。
I've done a fair amount of searching and it seems that most of what i can find is either a full blown service with hosting, or the red 5 suite. I've been trying for a day to get something going on with Red5, but honestly I haven't done any flash or java development in over 6 years and this seems way too complicated when all i really want is a flash object i can stick on a webpage.
我进行了大量搜索,似乎我能找到的大部分内容要么是完整的托管服务,要么是红色 5 套件。我已经尝试了一天来使用 Red5 进行一些操作,但老实说,我已经 6 年多没有做过任何 Flash 或 Java 开发了,这似乎太复杂了,而我真正想要的只是一个我可以坚持的 Flash 对象在网页上。
I've search google and github and am really surprised by the lack of simple options. Am I missing something obvious? Thanks.
我已经搜索了 google 和 github,并且对缺乏简单的选项感到非常惊讶。我错过了一些明显的东西吗?谢谢。
回答by jmw
I ended up going with Red 5 server and red5recorder. It was tricky to get everything working properly, but here's an overview of what I did:
我最终选择了 Red 5 服务器和 red5recorder。让一切正常工作很棘手,但这里是我所做的概述:
- Check out red5 version 0.9.1 (I couldn't get the latest version working with red5recorder). ant prepare; ant clean dist.
- Download the latest source for red5recorder.
- Install Eclipse Ganymede Sr2 (3.4.2) Enterprise Edition (the latest version that works with both the red5 plugin and the flash builder plugin).
- Install the red5 plugin according to http://wiki.red5.org/wiki/Red5Plugin
- Install the Adobe Flash Builder 4 plugin into eclipse-install-dir/flash-builder and built it against the eclipse in eclipse-install-dir
Create a New Dynamic Web Project. I named it Red5Server. Select a New Target Runtime -> Infared | Red5 Server. Target the distdirectory in the red5 checkout. so for me:
- auto deploy dir: /Users/julia/code/red5-0.9.1.svn/dist/webapps/
- start script: /Users/julia/code/red5-0.9.1.svn/dist/red5-debug.sh
- stop script: /Users/julia/code/red5-0.9.1.svn/dist/red5-shutdown.sh
Import Flash Builder Project - red5recorder
- Right click Red5Server | Run as.. | Run on Server. It should start up the server and show Directory listing for localhost:5080/Red5Server
- In red5recorder's Recorder class, change server to be rtmp://127.0.0.1/Red5Server/
- Right click on red5recorder.mxml and run it as an application. It should pop up a browser and the recorder should successfully connect to your webcam.
- 查看 red5 版本 0.9.1(我无法使用 red5recorder 获得最新版本)。蚂蚁准备;蚂蚁清洁区
- 下载 red5recorder 的最新源。
- 安装 Eclipse Ganymede Sr2 (3.4.2) 企业版(适用于 red5 插件和 flash builder 插件的最新版本)。
- 根据http://wiki.red5.org/wiki/Red5Plugin安装red5插件
- 将 Adobe Flash Builder 4 插件安装到 eclipse-install-dir/flash-builder 中,并在 eclipse-install-dir 中针对 eclipse 构建它
创建一个新的动态 Web 项目。我将其命名为 Red5Server。选择一个新的目标运行时 -> Infared | Red5 服务器。以 red5 结帐中的dist目录为目标。所以对我来说:
- 自动部署目录:/Users/julia/code/red5-0.9.1.svn/dist/webapps/
- 启动脚本:/Users/julia/code/red5-0.9.1.svn/dist/red5-debug.sh
- 停止脚本:/Users/julia/code/red5-0.9.1.svn/dist/red5-shutdown.sh
导入 Flash Builder 项目 - red5recorder
- 右键单击 Red5Server | 运行为... | 在服务器上运行。它应该启动服务器并显示 localhost:5080/Red5Server 的目录列表
- 在 red5recorder 的 Recorder 类中,将 server 改为 rtmp://127.0.0.1/Red5Server/
- 右键单击 red5recorder.mxml 并将其作为应用程序运行。它应该会弹出一个浏览器,并且录像机应该成功连接到您的网络摄像头。
Now, red5recorder is really broken out of the box. It required quite a bit of tweaking to get it to do what it says it will, and once I was more comfortable, I ended up refactoring it altogether to do what I wanted.
现在,red5recorder 真的开箱即用了。它需要大量的调整才能让它按照它所说的去做,一旦我感觉更舒服,我最终完全重构它来做我想做的事。
回答by Paul Gregtheitroade
There are "simple" demo publish and playback examples for Flash in our source tree. When I say simple I mean dead-simple, have you looked into these?
Broadcast / publish - http://red5.googlecode.com/svn/flash/trunk/simpleBroadcaster.fla
Playback - http://red5.googlecode.com/svn/flash/trunk/simpleSubscriber.fla
Flash examples: http://red5.googlecode.com/svn/flash/trunk/
我们的源代码树中有 Flash 的“简单”演示发布和播放示例。当我说简单时,我的意思是非常简单,你研究过这些吗?
广播/发布 - http://red5.googlecode.com/svn/flash/trunk/simpleBroadcaster.fla
播放 - http://red5.googlecode.com/svn/flash/trunk/simpleSubscriber.fla
Flash 示例:http:// /red5.googlecode.com/svn/flash/trunk/
回答by Omar Al-Ithawi
I'm currently evaluating and reading the rtmp-nginx-module. It looksmore stable and very well documented than the other peers I've tried:
我目前正在评估和阅读rtmp-nginx-module。与我尝试过的其他同行相比,它看起来更稳定且文档齐全:
- RTMPLite:Works well with VideoIO.swf however it's not easily extensible.
- Red5:Good luck getting it working correctly!
- RTMPLite:与 VideoIO.swf 配合良好,但不容易扩展。
- Red5:祝它正常工作!

