Skip to main content
Known Participant
November 28, 2012
Question

How to Restream RTMP

  • November 28, 2012
  • 1 reply
  • 4403 views

Well after all , thank you for your forum, here we go.

I was looking for about weeks to find the solution but now im stuck, even on your forum i didnt find enough informations about what i'm looking for. Ok , Whats My probleme? Well I need to restream an RTMP,but no informations available or far away from what i want.

If i do have controle of the RTMP link? No (but its only for education) so i want to perform into.

Im jalouse that wowza community they offer this solution to their users even if you dont have any controle of the server , you need only the link of the rtmp and the playpath and put them into rtmp.stream

So i would like to get some more informations on how it works with FMS 4 Thank You , sorry for my english. a Frensh guy here

This topic has been closed for replies.

1 reply

November 28, 2012

Hi,

Your query is not clear. What do you mean by restream? What are you trying to do here?

yaboutAuthor
Known Participant
November 28, 2012

Hi Thank you for your repley.

Well lets say i have a link : rtmp://server-ip/stream (i dont have any controle on it). So i would like to restream it with flash media server 4, to get a link like rtmp://myserver-ip/mystream

November 29, 2012

This can be achieved using server side play of the 1st stream and then publish that stream.

So, you can write an server side app in which you make connection to rtmp://server-ip/given_app and then after successful connection, you can do server side play of the stream. When you receive NetStream.Play.Start status then you can publish that stream.

Following is the sample code:

     nc=new NetConnection();

     nc.connect("rtmp://server-ip/given_app");

    

     nc.onStatus=function(evt){

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

               streamObj=Stream.get("foo");

               streamObj.play(stream_name);

               streamObj.onStatus=function(info){

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

                          ns=new NetStream(nc);

                          ns.attach(streamObj);

                          ns.publish(stream_name);

                          ns.onStatus=function(obj){

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

                                    trace("Publish Started");

                                                                                          }

                                                                           }

                    }

                   }

               }

          }