Skip navigation
kaka2kool
Currently Being Moderated

Multi-point publishing with MBR - Help!

Feb 6, 2014 3:03 AM

Hi,

 

I've been trying MPP for the last few days and it works fine for single stream but when I have 3 stream, at different bitrates, pnly the last one works, other work for short period and then they stop

 

Here is the code I am using. Please guide as to how I can change this code to republish more than one stream!

 

 

// Called when the client publishes

application.onPublish = function(client, myStream) {

    trace(myStream.name + " is publishing into application " + application.name);

    // This is an example of using the multi-point publish feature to republish

    // streams to another application instance on the local server.

    if (application.name == "live/_definst_"){

        trace("Republishing the stream " + myStream.name + "into /livepkgr2");

        nc = new NetConnection();

        nc.connect( "rtmp://localhost/livepkgr2" );

        ns = new NetStream(nc);

        // called when the server NetStream object has a status

        ns.onStatus = function(info) {

            trace("Stream Status: " + info.code)

            if (info.code == "NetStream.Publish.Start") {

                trace("The stream is now publishing");

            }         

        }

        ns.setBufferTime(2);

        ns.attach(myStream);

        ns.publish( myStream.name +"?adbe-live-event=liveevent", "live" );

    }

}

 

 

 

application.onUnpublish = function( client, myStream ) {

    trace(myStream.name + " is unpublishing"  );

}

 

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points