开发者

Record camera directly from website to server

I am trying to come up with a solution where I can use some application embedded i开发者_JAVA百科nto the website (assuming something in flash to cover as many platforms as possible) where the user can record videos with sound from a webcam that are streamed across to my server so they can be stored.

I don't want to store the captured video & sound on the users computer if that is possible to prevent any issues with space etc.

I have had a look at packages like http://www.red5.org/ but that is just the server side of things and need to find some form of flash app that can capture and send the data to there server from the browser.

Has anyone got any ideas on what can be used to do this off the shelve or is this something that I will need to implement myself!?


The key here is rtmp. After you installed red5 and got it working (firewalls etc), you can start to work on the client-side. If you choose flash, I advice you to use Actionscript 3.

The beginning is to open a NetConnection to your server:

var nc:NetConnection = new NetConnection();
nc.connect("rtmp://YOUR_SERVER/YOUR_APP_NAME/");

where YOUR_SERVER is the url of your server, YOUR_APP_NAME is the name of the Red5 application you are using for your project. If you download Red5 you can see some examples I think, also you can find some tutorials. There are also some nice demos to start with, so you won't be lost in the beginning.

And so, after the NetConnection is opened, you can use the NetStream class. The trick here is to attach a camera to it (use the attachCamera method), and then the real trick is the method publish.

Publish expects two parameters, a name and a type. Name will be the filename on your server, type can be some major values, like record, append, live. Record is recording a new stream, or overwriting I think, append is to append a previous one, live is the type of live streams (like conferences).

Hope this helps you to start, also try to do some searching, but these are the things where you can start. If you have problems, feel free to ask.

Check these two classes in the reference:

NetConnection and NetStream.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜