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.
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.
I've search google and github and am really surprised by the lack of simple options. Am I missing something obvious? Thanks.
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:
- 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 dist directory 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.
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.
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/
I'm currently evaluating and reading the rtmp-nginx-module. It looks more stable and very well documented than the other peers I've tried:
- RTMPLite: Works well with VideoIO.swf however it's not easily extensible.
- Red5: Good luck getting it working correctly!