Skip to main content
Participant
July 26, 2013
Question

Problem of republishing remote rtmp live stream with AMF

  • July 26, 2013
  • 0 replies
  • 1052 views

Hi, Guys

I am trying recieving one live stream from a remote rtmp server and republishing this stream in AMF.

a remote rtmp (rtmp://192.168.1.100/live/remotestream)

AMF instance(codes in application/app/main.asc) recieve and republish to another AMF instance.

I can watch with url(rtmp://192.168.1.100/live/remotestream ) in a player (ex. OSMF player).

But,no data from remote rtmp streaming can be recieved in AMF.

--------------------------------------------------------------------

Here is the log:

NetConnection.Connect.Success

Sending error message: Method not found (onBWDone).

mystream.onStatus: NetStream.Publish.Start

mystream.onStatus: NetStream.Play.Reset

--------------------------------------------------------------------

My codes in application/app/main.asc

application.onAppStart = function()

{

 

          mystream = Stream.get("myvideo");

          myRemoteConn = new NetConnection();

          myRemoteConn.connect("rtmp://192.168.1.100/live");

 

          myRemoteConn.onStatus =function(info){

           trace(info.code);

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

                mystream.play("remotestream", -1, -1, true, myRemoteConn);

                //mystream.play("sample", 0, -1, true);<-----if play a local flv video file ,it works.republish fine.

           }

    }

          nc = new NetConnection();

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

 

          ns = new NetStream(nc); 

          ns.setBufferTime(2);

    mystream.onStatus = function(sinfo)

    {

        trace("mystream.onStatus: "+sinfo.code);

        if(sinfo.code == "NetStream.Publish.Start")

        {

                              attach_retVal = ns.attach(mystream);

          

            if(attach_retVal==true){

                    ns.publish(mystream.name,"live");

            }

        }

 

    }

}

This topic has been closed for replies.