Skip to main content
October 23, 2012
Question

Pull external RTMP stream as live source.

  • October 23, 2012
  • 1 reply
  • 8721 views

Is it possible to pull in an external rtmp link and use it as live source. Instread of using FME as the live source, I would like to re-stream another RTMP link.

I've done this with ease in another rtmp streaming server, it's been while since I've done something like this using FMS/AMS.

Thank you in advance.

    This topic has been closed for replies.

    1 reply

    October 24, 2012

    This is the code I have thus far. I see this in my logs;

    Connected to Akamai : NetConnection.Connect.Success

    Publish??? : NetStream.Connect.Success

    application.onAppStart = function(){

              nc = new NetConnection();

              nc.connect("rtmp://cpxxxxx.live.edgefcs.net/live/xxxxxxxxxx");

              nc.onStatus = function(infonc){

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

                                  trace("Connected to Akamai : " + infonc.code);

                                  ns = new NetStream(nc);

                                  ns.setBufferTime(1);

                                  ns.attach("mylivestream");

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

                                  ns.onStatus = function(infons){

                                            trace("\nPublish??? : " + infons.code);

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

                                                      trace("\nPublished : " + infons.code);

                                            }

                                  }

                        }

              }

    }

    I also have application.onConnect for the client and see my client connect, but nothing plays.

    Thank you in advance.

    October 24, 2012

    Yet another update.

    I have enabled IDENT on my AMS server, allowing me to use the Akamai flash test page.

    When the client connects I see in my server application log:

    Sending error message: Method not found (getStreamLength).

    Also the client reports ERROR STREAM NOT FOUND.

    Which allows me to confirm the publish of the stream is not working.

    Any guidancewould be great, thanks.

    Adobe Employee
    October 24, 2012

    Hey Adrian,

    You need to use the Stream.play() method in order to play a live stream on server.

    This method accepts the remote NetConnection apart from the stream name.

    SSAS will look something like this,

    application.myRemoteConn = new NetConnection();

    application.myRemoteConn.onStatus = function(info)

    {

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

    application.myStream = Stream.get("foo");

    if (application.myStream)

    {

    //play the stream from remote server once connection is successful

    application.myStream.play("Movie1", 0, -1, true, application.myRemoteConn);

    }

    };

    //connect to remote server where stream is already published

    application.myRemoteConn.connect(rtmp://movie.com/movieApp);

    If successful, this is like a client (e.g. FMLE) publishing a live stream to the server.

    Once this is done, you then need to use the NetStream object on server (similar to the code snippet that you provided in comment above) to attach to that live stream and start publishing to another remote server.