Skip to main content
Known Participant
November 4, 2012
Question

Push-stream stability problem

  • November 4, 2012
  • 5 replies
  • 1021 views

I have created the client-server application to switch streams and republish them as single continious stream to the remote server. I republish additional stream (myStream) by NetStream.publish() methode In the server-side script (main.asc).
This is fragment of the long script:



nc = new NetConnection();

nc.connect( "rtmp://remoteserver/live" );

ns = new NetStream(nc);

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("livestream", "live");

Unfortunately, republishing push-stream "livestream" vanishes soon in some minute after start.

Is it possible to make push stream more stable one?

Are there any methodes?


    This topic is closed to new replies. Start a new post to keep the conversation going.

    5 replies

    Participating Frequently
    November 5, 2012

    I will investigate and get back to you.

    Participating Frequently
    November 5, 2012

    I used the follwoing server side code.

    test1 application has the following main.asc and test2 is a blank application.

    test1 - main.asc

    application.onConnect = function(clientObj){

              trace("application.onConnect");

              application.acceptConnection(clientObj);

    }

    application.onPublish = function(clientObj,streamObj){

              trace("application.onPublish");

              nc = new NetConnection();

              nc.onStatus = function ( obj ){

                        trace("NC : >>>>> "+obj.code);

                        if(obj.code == "NetConnection.Connect.Success"){

                                  ns = new NetStream(nc);

                                  ns.attach(streamObj);

                                  ns.onStatus = function(statusObj){

                                            trace("NS : >>>>> "+statusObj.code);

                                  }

                                  ns.publish("livestream","live");

                        }

              }

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

    }

    > I published a stream named "livestream" to test1. It republished to "test2" with stream name "livestream".

    > I played back the "livestream" from "test2" application.

    > After a while I stopped publishing to test1 and the playback stopped from "test2".

    > When I did republish ( i.e started publishing again with same stream name ) to "test1", "test2" playback resumed.

    Known Participant
    November 5, 2012

    I did it too, but my push-stream disappear on the romote server in some minutes after start without any messages in my local server logs.
    Is there any diagnostics and stable republishing mode for this case?