Legal
The views expressed in this blog are my own and do not necessarily reflect the views of Adobe Systems Incorporated.
Search
June 9, 2006
Record Video From Webcam and Post To Drupal (With Source Code)
For my talk to the Boston PHP user group last week, I built on Chritophe's sample that showed recording video from a webcam, and then publishing that to a Drupal based blog. Here is the code (MXML Format). To get this running, you'll need a copy of Flash Media Server (free developer version available) and a working webcam (I'm not really into error checking :) ). Once you download and install Flash Media Server, in C:\Program Files\Macromedia\Flash Media Server 2\applications\, create a directory called flex_videoconference. A few things to note:
In the source, you'll see:
nc = new NetConnection();
nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
nc.connect( "rtmp:/flex_videoconference");
You need the line ...=flash.net.ObjectEncoding.AMF0 because FMS doesn't do AMF3. The line nc.connect("rtmp:/flex_videoconference"); is equivalent to nc.connect("rtmp://localhost/flex_videoconference"); so if you're connecting to a remote server, you'll want to change localhost, obviously.
The line nsPublish.publish("christophe", "record"); tells FMS to record the stream so you can play it back. Valid values are "record", "append", and "live". The default value is "live". (Lookup NetStream in the Flex help for more information).
Nearly everything works in the publishing method, but I can't figure out how to properly encode the HTML string being sent to Drupal so that it will display the movie properly. I have also created a MediaPlayer.swf video player and put that in my Drupal theme directory, but because I can't get the encoding working properly, then it doesn't matter. If you have knowledge of the BlogAPI for Drupal, please help!
Regardless, even if you don't use it, you've got a way to record video to Flash Media Server and then to play it back in a simple example.
Comments
Could you please wrap the code in a code tag? :)
Hello,
thanks for the bits here. I'm wondering...
I use Drupal for everything. I have a number of projects that are ready to heead down the road arm in arm with Flash Media Server.
Is it possible that you and Adobe could be gently persuaded to help/team up with Drupal to provide some simple code that would help with a basic OOTB integration with Drupal fro Flash Media server?
More and more companies are using various applications. What about all the wonderful Open Source CMS projects started up right now that can invest in Flash Media server in order to create their own branded projects?
Please contact me about this. I don't think is is a lot of code, but your help could bridge a serious gap and show some major collaboration in a few simple steps.
Hello,
thanks for the bits here. I'm wondering...
I use Drupal for everything. I have a number of projects that are ready to heead down the road arm in arm with Flash Media Server.
Is it possible that you and Adobe could be gently persuaded to help/team up with Drupal to provide some simple code that would help with a basic OOTB integration with Drupal fro Flash Media server?
More and more companies are using various applications. What about all the wonderful Open Source CMS projects started up right now that can invest in Flash Media server in order to create their own branded projects?
Please contact me about this. I don't think is is a lot of code, but your help could bridge a serious gap and show some major collaboration in a few simple steps.
Thank you for signing in, You may now comment. (Sign Out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)