Skip to main content
Inspiring
December 12, 2011
Question

problem in switching between different live&recorded resources

  • December 12, 2011
  • 1 reply
  • 959 views

hello, everyone here. i've started a project to switch different live&recorded ADs .f4v streams.  i use the Stream Class as a hub to switch different live and record streams and finally to produce a merged stream.  everything is OK when i freely switch recorded videos, and the client side can view the merged video. however, when i switch from the playing recorded ad stream to live stream and vice versa, the produced merged stream viewed at the client side is freezed at the switching point, and after several mininutes the merged stream return to normal state and the viewers can view the switched new stream. then what is the matter? thank you for your reply. my partial asc file is as follows:

var stream = Stream.get("mp4:mergedvid.f4v");

application.onAppStart = function()

{

      trace("the app is start...");

    

      if(stream)

      {

            stream.record("append");

      }

}

Client.prototype.doStreamSwitch = function(streamName)
{

     if(stream)
    {
            stream.flush();
            stream.play(false);
            if(isLivePublishing)      // the stream is recorded ad stream or live stream
            {
                stream.play("mp4:" + streamName);
            }
     else
     {
           stream.play("mp4:" + streamName, 0, -1);   //the record ad will played from start to end if no other live or record stream switch in.
     }
   }

}

    This topic has been closed for replies.

    1 reply

    Nikhil_Kalyan
    Participating Frequently
    December 12, 2011

    Hi,

    Are you playing back the recorded merged video as a vod or are you playing it back while it is being recorded ? Can you please try playing back after the recording is done, to see if the freeze is present in the recording as well ?

    Also, are the codecs of the live and the recorded streams similar ?

    Thank you !

    peixd_fmsAuthor
    Inspiring
    December 12, 2011

    follow your advice, i playback the recorded video and get the same result. the codecs of the live and the recorded streams is h264 but with different bitrate. 

    the following info is copied from my fms 4.0 server when i do stream switch.

    Fri 02:07:58 AM: Warning from libmp4.dll: Backward timestamp packet has been dropped.
    Fri 02:07:59 AM: Warning from libmp4.dll: Backward timestamp packet has been dropped.

    Fri 02:07:59 AM: Failed to record mergedvid.f4v (Unknown Error).

    maybe next time i should change the live stream's rate to be the same as recorded stream's rate to solve the problem?