我必须让FMS从我的相机发布流吗?

时间:2011-07-03 19:34:43

标签: php publish rtmp flash-media-server live-streaming

我正在建立一个实时流媒体网站,我正在使用 1- FMS 2- Apache webserver

我做了订阅者,我运作良好。 但我需要建立发布者,以允许用户从他们的相机广播他们的流。

我测试了一个使用actionscript构建的发布者,直到我在本地主机上安装了fms,它才起作用,但我需要一个任何用户都可以在他的网络浏览器中使用的发布者。

我的出版商:

   protected function application1_creationCompleteHandler(event:FlexEvent):void 
        { 
            connection = new NetConnection(); 
            connection.connect("rtmp:/live"); 
            connection.addEventListener(NetStatusEvent.NET_STATUS,onConnected); 

        } 
   private function setupVideo():void 
        { 
            //setting up outgoing devices 
            camera = Camera.getCamera(); 
            camera.setMode(640,480,30); 
            mic = Microphone.getMicrophone(); 

            //setting up outgoing Stream 
            outStream = new NetStream(connection); 
            outStream.attachCamera(camera); 
            outStream.attachAudio(mic); 
            outStream.publish("EraMaX-Live"); 

            //setting up outgoing video & attach outgoing devices 
            outVideo = new Video(); 
            outVideo.attachCamera(camera);  
            //setting up incomming Stream 
            inStream = new NetStream(connection); 
            inStream.play("EraMaX-Live"); 

            //setting up incomming video & attach incoming Stream 
            inVideo = new Video(); 
            inVideo.attachNetStream(inStream); 

            //wrap video object 
            outVideoWrapper = new UIComponent(); 
            outVideoWrapper.addChild(outVideo); 
            addElement(outVideoWrapper); 

            inVideoWrapper = new UIComponent(); 
            inVideoWrapper.addChild(inVideo); 
            addElement(inVideoWrapper); 
            inVideoWrapper.move(400,0); 
            //setting up incomming video 

        } 

所以我的问题是我必须让FMS从我的相机发布一个流到我的网站吗?

1 个答案:

答案 0 :(得分:0)

如果您想要直播视频流,则需要一个流媒体服务器。不一定是FMS,你也可以使用Red5,Wowza,甚至RTMPD或RTMPLite等开源解决方案。