Record browser video using Flash, PHP, Red5

I want to create an application with which I can record video (along with sound), as well as audio (only audio is preferably in mp3 format).

From some of the research I did, I found that I need a client application in flash or flex, an RTMP server (preferably RED5)

This is the code I used to get a working cam flash.

var camera:Camera = Camera.getCamera(); var video:Video = new Video(); video.attachCamera(camera); addChild(video); 

The problem is that I do not know how to send a stream to RED5.

Also, what 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 must have its own video and audio recordings. I love the way Facebook videos are embedded.

+4
source share
3 answers

Check it out: 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.

+1
source

Here is the exact AS3 code for publishing Flash video to a media server such as Red5, Wowza or AMS:

 //init vars public var nc:NetConnection; public var ns:NetStream; //net connection to media server nc = new NetConnection(); nc.connect("rtmp://yourmediaserver/oflaDemo/instance"); //net stream through which the recording data is sent ns = new NetStream(nc) //attach cam and mic to net stream ns.attachCamera(Camera.getCamera()) ns.attachAudio(Microphone.getMicrophone()) //send the data to the media server ns.publish("streamName","record"); 

For just audio ns.attachAudio line.

Flash Player cannot encode mp3 sound (it can be decoded). You will get sound encoded using NellyMoser ASAO. Speex is also an option. See this answer for more details .

oflaDemo is a Red5 application that supports the video that ships with Red5.

For a (commercial) Flash / HTML video recording solution that supports Red5 and PHP, you should check https://hdfvr.com .

Also, what I need to do so that I can store the video according to the user.

Just execute the PHP script (from the Flash client) that stores the information in the database. You can use POST or GET to send video data and sessions or cookies to retrieve user data.

0
source
 var video:Video; var camera:Camera = Camera.getCamera(); camera.addEventListener(ActivityEvent.ACTIVITY, active); video = new Video(); video.attachCamera(camera); function active(event:Event):void { addChild(video); camera.removeEventListener(ActivityEvent.ACTIVITY, active); } 
-1
source

All Articles