Skip to main content
March 21, 2007
Question

strange live stream recording issue

  • March 21, 2007
  • 2 replies
  • 430 views
We are trying to record longer live streams on FMS 2.0 real-time by duplicating the stream on the FMS and recording plus broadcasting at the same time. The recording seems to work but for some strange reason FMS stops recording after the first 4-5 minutes without throwing any error. Any idea what might be causing this? Which settings should we check? Any assistance is highly appreciated.

Here is the code portion that handles the recording ('play' is the stream that is published from the streaming client):

var stream = Stream.get('broadcast/'+chid+'/'+date.getTime());
stream.owner = this;
stream.onStatus = function(info) {
if (info.code == 'NetStream.Play.UnpublishNotify') {
application.saveVideo(this.owner, this.name, Stream.length(this.name));
}
};
stream.record();
stream.play('channel.'+chid);

Thank you.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    March 21, 2007
    This is similar to another problem that came up not sol long ago... it turned out to be how the stream variable was declared.

    Is the portion of code you posted part of a function? If so, this line:

    var stream = Stream.get('broadcast/'+chid+'/'+date.getTime());

    might be the problem.

    If you declare a variable inside of a function, the scope of that the variable is the function, not the application. When the function terminates, the variable will get garbage collected on the next GC. As I understand things, that will cause the stream to be closed.

    I might try assiging the stream var to the application object:

    application.stream = Stream.get('broadcast/'+chid+'/'+date.getTime());
    March 22, 2007
    Tried as you suggested and it worked. Thanks for saving the day!