开发者

Live video streaming website

we are looking forward towards developing a very interesting community portal that would help the user to broadcast their live videos across the community. I've been checking over sites like ustream.tv, justin.tv and wondering what/how Technology they been using to do so.

I am doing a lot of research over the last few days checking over the medium to do this effectively and figure out some of the leading companies in the domain like Ooyala.com, brightcove.com providing servers/technology to broadcast videos seamlessly across the globe. I will be signing up with any of these providers soon.

So my question is , how exactly would my website be catching with the live feed from the users cam, send the stream to ooyala/brightcove and further broadcast it开发者_开发技巧 to rest of the community users.

till now, I've figured out that Flash 8/ Flex does provide some inputs on fetching stream from users cam.

I would like to know if any of you guys have worked on this before/can throw some light on how exactly my approach should be.

Thanks in advance. dev-drupal


The easy way is to use a Flash/Flex Client with Red5 http://osflash.org/red5

The Flash Player has a method for using a video camera and the Red5 server is an open source Flash server that will record client streams.

I recommend setting up Red5 and playing with it. It does everything you need. Just look over the API and start writing test apps.

HOW TO GET VIDEO FROM USER CAMERA:

package {
    import flash.display.Sprite;
    import flash.media.Camera;
    import flash.media.Video;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.events.StatusEvent;
    import flash.events.MouseEvent;
    import flash.system.SecurityPanel;
    import flash.system.Security;

    public class Camera_getCameraExample extends Sprite {
        private var myTextField:TextField;
        private var cam:Camera;
        private var t:Timer = new Timer(1000);

        public function Camera_getCameraExample() {
            myTextField = new TextField();
            myTextField.x = 10;
            myTextField.y = 10;
            myTextField.background = true;
            myTextField.selectable = false;
            myTextField.autoSize = TextFieldAutoSize.LEFT;    

            cam = Camera.getCamera();

            if (!cam) {
                myTextField.text = "No camera is installed.";

            } else if (cam.muted) {
                myTextField.text = "To enable the use of the camera,\n"
                                 + "please click on this text field.\n" 
                                 + "When the Flash Player Settings dialog appears,\n"
                                 + "make sure to select the Allow radio button\n" 
                                 + "to grant access to your camera.";

                myTextField.addEventListener(MouseEvent.CLICK, clickHandler);

            }else {
                myTextField.text = "Connecting";
                connectCamera(); 
            }

            addChild(myTextField);

            t.addEventListener(TimerEvent.TIMER, timerHandler);
        }

        private function clickHandler(e:MouseEvent):void {
            Security.showSettings(SecurityPanel.PRIVACY);

            cam.addEventListener(StatusEvent.STATUS, statusHandler);

            myTextField.removeEventListener(MouseEvent.CLICK, clickHandler);
        }

        private function statusHandler(event:StatusEvent):void {

            if (event.code == "Camera.Unmuted") {
                connectCamera(); 
                cam.removeEventListener(StatusEvent.STATUS, statusHandler);
            }
        }

        private function connectCamera():void {
                var vid:Video = new Video(cam.width, cam.height);
                vid.x = 10;
                vid.y = 10;
                vid.attachCamera(cam);
                addChild(vid);    

                t.start();
        }

        private function timerHandler(event:TimerEvent):void {
            myTextField.y = cam.height + 20;
            myTextField.text = "";
            myTextField.appendText("bandwidth: " + cam.bandwidth + "\n");
            myTextField.appendText("currentFPS: " + Math.round(cam.currentFPS) + "\n");
            myTextField.appendText("fps: " + cam.fps + "\n");
            myTextField.appendText("keyFrameInterval: " + cam.keyFrameInterval + "\n");
        }
    }
}

HOW TO SEND VIDEO TO BRIGHT COVE

They have an API just read over it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜