使用 Flash、PHP、Red5 从浏览器录制视频
我希望构建一个应用程序,使用它可以录制视频(以及音频)和音频(最好仅录制 mp3 格式的音频)。
从我所做的一些研究中,我发现我需要一个 Flash 或 Flex 中的客户端应用程序、一个 RTMP 服务器(RED5 最好,因为它是免费的)
这是我用来让 cam 工作 flash 的代码。
var camera:Camera = Camera.getCamera();
var video:Video = new Video();
video.attachCamera(camera);
addChild(video);
问题是,我不知道如何将流发送到 RED5。
另外,我需要做什么才能根据用户存储视频。我正在创建的网站是用 PHP/MySQL 编写的,需要录制自己的视频和音频。我喜欢 Facebook 集成视频录制的方式。
I wish to build an application using which I can record video (along with audio) and also audio (only audio preferably in mp3 format).
From some research I did, I found I need a client app in flash or flex, a RTMP Server (RED5 preferable as its free)
This is the code which I used to get cam working flash.
var camera:Camera = Camera.getCamera();
var video:Video = new Video();
video.attachCamera(camera);
addChild(video);
The problem is, I don't know how to send the stream to RED5.
Also, what do I need to do so that I can store the video according to the user. The website I am creating is in PHP/MySQL and need to have their own videos and audios recorded. I love the way facebook has integrated Video Recording.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
下面是将视频从 Flash 发布到媒体服务器(如 Red5、Wowza 或 AMS)的确切 AS3 代码:
对于音频注释
ns.attachAudio
行。Flash Player 无法对 mp3 声音进行编码(但可以解码)。您将获得使用 NellyMoser ASAO 编码的声音。 Speex 也是一种选择。 请参阅此答案了解更多详细信息。
oflaDemo
是一款 Red5 应用程序,支持 Red5 附带的视频录制。对于支持 Red5 和 PHP 的(商业)Flash/HTML 视频录制解决方案,您应该查看 https://hdfvr.com。
只需执行一个 PHP 脚本(从 Flash 客户端)即可将信息保存在数据库中。您可以使用 POST 或 GET 发送视频数据,使用会话或 cookie 检索用户数据。
Here's the exact AS3 code for publishing video from Flash to a media server like Red5, Wowza or AMS:
For just audio comment the
ns.attachAudio
line .Flash Player can't encode mp3 sound (it can decode). You'll get sound encoded with NellyMoser ASAO. Speex is also an option. See this answer for more details.
oflaDemo
is a Red5 app that supports video recording that's shipped with Red5.For a (commercial) Flash/HTML video recording solution that supports Red5 and PHP you should check out https://hdfvr.com.
Just execute a PHP script (from the Flash client) that saves the info in the database. You can use POST or GET to send the video data and sessions or cookies to retrieve the user data.
检查这个:http:// www.actionscript.org/resources/articles/615/2/Getting-started-with-red5-server/Page2.html
它解释了如何连接和使用 RED5 并为您提供了一个示例。
Check this: http://www.actionscript.org/resources/articles/615/2/Getting-started-with-red5-server/Page2.html
It explains how to connect and use RED5 and gives you an example.