2010-03-04 162 views
3

我们期待着开发一个非常有趣的社区门户网站,帮助用户在整个社区中播放他们的直播视频。 我一直在检查网站,如ustream.tv,justin.tv,并想知道他们如何使用这种技术。现场视频流媒体网站

我在过去几天检查媒体做了很多研究,以便有效地做到这一点,并找出域中的一些领先公司,如Ooyala.com,brightcove.com提供服务器/技术来播放视频无缝地遍布全球。 我将很快与任何这些提供商签约。

所以我的问题是,我的网站到底会如何捕捉来自用户凸轮的实时反馈,将流发送到ooyala/brightcove并进一步将其广播给社区其他用户。到目前为止,我已经发现Flash 8/Flex确实提供了一些用于从用户cam获取流的输入。

我想知道你们之前是否有过这方面的工作/可以告诉我的方法应该如何。

在此先感谢。 DEV-的Drupal

+1

认为这被更好地标记为Flash和Flash Media Server,而不是Flex或PHP。观看Flash/FMS标签的人们可能会帮助更多。 – ryanstewart 2010-03-04 18:48:28

+0

如果您了解这一点,请让我知道。我打算想出一个类似的门户, – gmhk 2010-03-05 19:09:42

回答

0

最简单的方法是使用一个Flash/Flex中的客户与Red5的http://osflash.org/red5

Flash播放器具有使用视频摄像机和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,只是读了它。

+0

不,我们不想为广播视频设置Red5,我们将把广播部分留给Ooyala/brightcove。 我想知道2件事情。 1.我将如何收集来自用户凸轮的实时流 2.我如何将此实时流连接到Ooyala/brightcove服务器。 – user274383 2010-03-05 10:08:36