Skip to main content
Participating Frequently
February 18, 2010
Question

Problem playing remote live stream from FMS

  • February 18, 2010
  • 2 replies
  • 4985 views

Hello all,

I'm having problems playing remote live streams from FMS (server-side) that I can play with any other player (client-side)

Example of server-side application which plays a remote live stream:

nc = new NetConnection();
nc.connect("rtmp://remoteserver/live");
stream = Stream.get("localStream");
stream.play("remoteStream.flv", -1, -1, true, nc);

This code works only sometimes.


Most of the times, FMS is able to connect to remote string and the localStream dispatches events:
   NetStream.Publish.Strart
   NetStream.Play.Reset

In this case, FMS is publishing the local stream but it is not playing the remoteStrem on it.

The rest of the times, localStream dispatches events:
   NetStream.Publish.Strart
   NetStream.Play.Reset
   NetStream.Play.Start
   NetStream.Data.Start

In this case FMS plays the remoteStream correctly.

Any hint to solve this issue?

Regards.

    This topic has been closed for replies.

    2 replies

    Sunil Kumar Sah
    Inspiring
    March 25, 2010

    I am facing a very critical issue with same "NetStream.Play.Reset".When happen in my case is NetStream sound play twice at same time and when I doing pause one sound has paused and another sound playing continuesly. I got stuck on this. I have written my code in Flash ActionScript 2.0

    Request you to please help me to solve this.

    Thanks & regards

    Sunil Kumar

    Mumbai - India

    sunilkumarrmh@gmail.com

    0091-9322836660

    0091-22-30842875

    Participating Frequently
    March 25, 2010

    Is your set-up same as "nvazquez at uned" set up , i mean do you also use Wowza?

    Sunil Kumar Sah
    Inspiring
    March 26, 2010

    No, I am not using that. I am using simply NetConnection object which to connect FMS.

    example.

    var nc:NetConnection;

    var ns:NetStream;

    nc = new NetConnection()

    nc.connect("rtmp://localhost/vod/") // For live website I am using Lime Light Network and Edgecast

    ns = new NetStream(nc)

    my_video.attachVideo(ns);

    ns.play("sample", 0, -1)

    Please suggest me why audio is repeating twice of streaming video even when I am reseting the NetConnection and NetStream Object and when I do refresh then it is working fine.This is happening irregular bases not every time.

    Thanks & regards

    Sunil Kumar

    Participating Frequently
    February 18, 2010

    Try this:

    var nc;

    var myStream;

    application.onAppStart = function(){

         nc = new NetConnection();

         myStream = Stream.get("localstream");

         nc.onStatus = function(info){

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

                             myStream.play("remoteStream", -1, -1, true, nc);

                   }

         }

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

    }

    I am assuming you are publishing "remotestream" on "live" app of "remoteserver"

    let me know if this does not work either

    Participating Frequently
    February 19, 2010

    Thanks, I tried your code and it works when playing a remote live stream on another FMS.

    But the remote live stream is not on a FMS but on a Wowza Server which re-streams an RTSP stream over RTMP.

    With this code:

    var nc;
    var myStream;

    application.onAppStart = function(){

         nc = new NetConnection();

         myStream = Stream.get("localstream");
         myStream.onStatus= function(info){
               trace(info.code);
         }

         nc.onStatus = function(info){

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

                    myStream.play("remoteLive.sdp", -1, -1, true, nc);

               }

         }

         nc.connect("rtmp://remoteServer/live");
    }

    Every live stream player I tried was able to play the remote stream "remoteLive.sdp", but FMS play it only sometimes. This is the output log of the FMS application:

    NetConnection.Connect.Success
    NetStream.Publish.Start
    NetStream.Play.Reset        <--------------------------------- Stuck there, stream won't play
    Unloaded application instance wowza4/_definst_ <--- Reload app
    NetConnection.Connect.Success
    NetStream.Publish.Start
    NetStream.Play.Reset        <--------------------------------- Stuck there, stream won't play
    Unloaded application instance wowza4/_definst_ <--- Reload app
    NetConnection.Connect.Success
    NetStream.Publish.Start
    NetStream.Play.Reset
    NetStream.Play.Start         <--------------------------------- Stream is playing just fine
    NetStream.Data.Start
    Unloaded application instance wowza4/_definst_ <--- Reload app
    NetConnection.Connect.Success
    NetStream.Publish.Start
    NetStream.Play.Reset       <--------------------------------- Stuck there, stream won't play

    Any idea? Why FMS won't play it everytime?

    Regards