3

ユーザーがコミュニティ全体でライブビデオをブロードキャストするのに役立つ非常に興味深いコミュニティポータルの開発を楽しみにしています. 私は ustream.tv や justin.tv のようなサイトを調べていて、彼らがどのような技術をどのように使っているのか疑問に思っていました。

私はここ数日間、メディアをチェックしてこれを効果的に行うために多くの調査を行っており、Ooyala.com、brightcove.com のようなドメイン内の主要企業のいくつかを見つけ出し、世界中でビデオをシームレスにブロードキャストするためのサーバー/テクノロジーを提供しています。 . 私はすぐにこれらのプロバイダーのいずれかにサインアップします。

だから私の質問は、私のウェブサイトがユーザーカムからのライブフィードをどのようにキャッチし、ストリームをooyala /ブライトコーブに送信し、さらにコミュニティユーザーの残りにブロードキャストするかということです.

これまでのところ、Flash 8/Flex はユーザーのカムからストリームをフェッチする際にいくつかの入力を提供することがわかりました。

以前にこれに取り組んだことがあるかどうか、または私のアプローチがどのように正確に行われるべきかについて光を当てることができるかどうかを知りたいです。

前もって感謝します。開発-drupal

4

1 に答える 1

0

簡単な方法は、Red5 http://osflash.org/red5で Flash/Flex クライアントを使用することです。

Flash Player にはビデオ カメラを使用する方法があり、Red5 サーバーはクライアント ストリームを記録するオープン ソースの Flash サーバーです。

Red5をセットアップして遊んでみることをお勧めします。それはあなたが必要とするすべてを行います。API に目を通し、テスト アプリの作成を開始するだけです。

ユーザーカメラからビデオを取得する方法:

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");
        }
    }
}

BRIGHT COVE にビデオを送信する方法

それらには、それを読み取るだけの API があります。

于 2010-03-04T21:22:32.007 に答える