Skip navigation
D.Sidney
Currently Being Moderated

Problem of republishing remote rtmp live stream with AMF

Jul 25, 2013 7:49 PM

Tags: #live #server #streaming #rtmp #live_streaming #republish

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");

            }

        }

 

    }

}

 

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