In continuation of my excitement to work with Adobe Stratus and test the RTMFP protocol capabilities, here is another example on how two flash player 10 clients can exchange video feeds with each other without the need of routing through any media server like Flash Media Server. In my earlier post where the source code was in accordance to Ryan Stewart’s demo, to demonstrate text chat capabilities using Adobe Stratus service.

Just to extend and be original, I wanted to test the video feed exchange over Adobe Stratus, and to my surprise I found that the plumbing code required to bind the feeds to the NetStreams is very similar when working with text chat. In fact when you look at the code, you will find that only two new methods are written to publish and subscribe the video streams

//Used to bind your local camera (webcam) to the VideoDisplay
private function nearId_videoDisplay_creationComplete():void
{
   var camera:Camera = Camera.getCamera();
   if (camera)
   {
      vdispNearId.attachCamera(camera);
   }
   else
   {
      Alert.show("You don't seem to have a camera.");
   }
}

//Used for streaming your local webcam video feed
public function onVideoSend():void
{
     var camera:Camera = Camera.getCamera();
     //var mic:Microphone = Microphone.getMicrophone();
     sendStream.attachCamera(camera);
     //sendStream.attachAudio(mic);
     btnNearIdVideoStream.enabled= false;

}

//Used for displaying remote camera(webcam) video feed
public function onVideoRecieve():void
{
     remoteVideo = new Video();
     remoteVideo.width = 320;
     remoteVideo.height = 240;
     remoteVideo.attachNetStream(recievedStream);
     vdispFarId.addChild(remoteVideo);

}

The two NetStreams, sendStream and recievedStream, is what one would work it. You can practically attache (publish) audio, video and byteArray data to the sendStream, and the remote host can subscribe to your feed. One thing that really makes me interested with RTMFP is the ISP bandwidth cost. Earlier, when AV exchange sites (running on Media Servers like FMS), had to bare the cost of the video feed exchange over their bandwidth, but with RTMFP, they no longer have. With services like Adobe Stratus, which only maintain the session between the two Flash Player 10 clients, and the binary feeds exchanged between the Flash Player 10 clients is at the user’s cost.

Stratus Video Feed App

Stratus Video Feed App

Below is the source code attached for you to try to and test. Also remember you would need Flash Player 10 installed and two different browser to test out. Also you would need your Adobe Stratus Developer Key which can be obtained here.

Sample Stratus Video App Zip


No Comments on “Video feed exchange using Adobe Stratus”

You can track this conversation through its atom feed.

No one has commented on this entry yet.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>