网络摄像头流CDN FMS摄像头、网络、FMS、CDN

2023-09-08 11:21:31 作者:我坐在这看着你装i

我没有我自己的Flash媒体服务器。不过,我可以用Highwinds CDN。它们运行在自己的CDN FMS。当你安排一个现场活动,Highwinds给你两个网址:服务器和流名称。 例如:

  

服务器:   RTMP://fli003.am4.hwcdn.net/XXXX/的 definst 的

     

流名称:   FLI / 00000-streamName中EN codeRUSER = XXX和放大器;恩?coderpassword = YYY

这两个网址可以粘贴到Flash媒体直播恩codeR应用程序流的现场活动。在Flash媒体直播恩codeR各自的字段名称为FMS URL和流。

我现在已经成功建立了一个连接(我想?)到FMS服务器。 问题:流没有显示在网页上,而且似乎也没有提交到CDN

 函数的onStatus(E:将NetStatusEvent):无效{

跟踪(e.info code);

    开关(e.info。code){

      案值为NetConnection.Connect.Success:
        VAR NS:NetStream的=新的NetStream(康涅狄格州);

        ns.addEventListener(NetStatusEvent.NET_STATUS,的onStatus);

        变种相机= Camera.getCamera();
            camera.setLoopback(真正的);
            camera.setQuality(0,100);
            的Camera.setMode(640,480,25)
        变种麦克风= Microphone.getMicrophone();

        如果(相机!= NULL){
            myVid.attachCamera(照相机);
            ns.attachCamera(照相机);
// ns.play();
        }
        如果(MIC!= NULL){
            ns.attachAudio(MIC);
        }

        ns.publish(FLI / 00000-streamName中EN codeRUSER = XXX和放大器;恩?coderpassword = YYY,活);
        打破;
        // ...
    }
}

VAR康恩:的NetConnection =新的NetConnection();



conn.addEventListener(NetStatusEvent.NET_STATUS,的onStatus);
conn.connect(设rtmp://fli003.am4.hwcdn.net/XXXX/_definst_);


// VAR柜台:= 0;
//conn.onBWDone =功能(kbitDown:编号,deltaDown:号码,deltaTime:数量,延迟:数字){};
NetConnection.prototype.onBWDone =功能(p_bw){
   //跟踪(onBWDone:+ p_bw);
}
NetConnection.prototype.onBWCheck =功能(){
   //返回++计数器;
}
 

在SMIL文件是存在的,但我怀疑没有数据到达服务器。 该播放器只显示一个加载动画。

和我现在得到一个额外的

  

NetStream.Failed   NetStream.InvalidArg   NetStream.InvalidArg   后连接成功。不知道在哪里从错误来了。

解决方案

检查 NetStraem.publish()参考:

  // ...
康恩=新的NetConnection();
conn.addEventListener(NetStatusEvent.NET_STATUS,的onStatus);
conn.connect('设rtmp://fli003.am4.hwcdn.net/XXXX/definst');
// ...
私有函数的onStatus(E:将NetStatusEvent):无效{
    开关(e.info。code){
        案值为NetConnection.Connect.Success:
        NS =新的NetStream(康涅狄格州);
        ns.attachCamera(照相机);
        ns.publish(FLI / 00000名EN codeRUSER = XXX和放大器;恩?coderpassword = YYY,活);
        打破;
        // ...
    }
}
 
小编呕心整理 国内外主流GigE 千兆以太网 工业相机大全

I don't have my own Flash Media Server. I can however use the Highwinds CDN. They run FMS on their CDN. When you schedule a live event, Highwinds gives you two urls: the "server" and "stream name". Examples:

server: rtmp://fli003.am4.hwcdn.net/XXXX/definst

stream name: fli/00000-streamname?encoderuser=XXX&encoderpassword=YYY

These two urls can be pasted into the Flash Media Live Encoder application to stream the live event. The respective field names in Flash Media Live Encoder are "FMS URL" and "Stream".

I now have successfully established a connection (I think?) to the FMS server. The problem: the stream is not showing on the web, and it seems it is not submitted to the CDN.

function onStatus(e:NetStatusEvent):void {

trace(e.info.code);

    switch(e.info.code) {

      case "NetConnection.Connect.Success":
        var ns:NetStream = new NetStream(conn);

        ns.addEventListener(NetStatusEvent.NET_STATUS, onStatus);

        var camera = Camera.getCamera();
            camera.setLoopback(true);
            camera.setQuality( 0, 100 );
            camera.setMode(640, 480, 25)
        var mic = Microphone.getMicrophone();

        if (camera != null){
            myVid.attachCamera(camera);
            ns.attachCamera(camera);
//            ns.play();
        }
        if (mic != null) {
            ns.attachAudio(mic);
        }

        ns.publish("fli/00000-streamname?encoderuser=XXX&encoderpassword=YYY", "live");
        break;
        //...
    }
}

var conn:NetConnection = new NetConnection();



conn.addEventListener(NetStatusEvent.NET_STATUS, onStatus);
conn.connect("rtmp://fli003.am4.hwcdn.net/XXXX/_definst_");


//var counter:int = 0;
//conn.onBWDone = function(kbitDown:Number, deltaDown:Number, deltaTime:Number, latency:Number){ };
NetConnection.prototype.onBWDone = function(p_bw) {
   //trace("onBWDone: "+p_bw);
}
NetConnection.prototype.onBWCheck = function() {
   //return ++counter;
}

The smil file is there, but I suspect that no data arrives at the server. The player is only showing a loading animation.

And I now get an additional

NetStream.Failed NetStream.InvalidArg NetStream.InvalidArg after successfully connecting. No idea where that error came from.

解决方案

check the NetStraem.publish() reference:

//...
conn = new NetConnection();
conn.addEventListener(NetStatusEvent.NET_STATUS, onStatus);
conn.connect('rtmp://fli003.am4.hwcdn.net/XXXX/definst');
//...
private function onStatus(e:NetStatusEvent):void {
    switch(e.info.code) {
        case "NetConnection.Connect.Success":
        ns = new NetStream(conn);
        ns.attachCamera(camera);
        ns.publish("fli/00000-name?encoderuser=XXX&encoderpassword=YYY", "live");
        break;
        //...
    }
}