Skip to main content
Participant
July 5, 2008
Question

Record Live Stream with FMS3

  • July 5, 2008
  • 2 replies
  • 2179 views
How do I record a live stream in FMS3 and make the recorded streams available in the VOD folder?
    This topic has been closed for replies.

    2 replies

    Participating Frequently
    July 7, 2008
    Recording a live stream on FMS can be initiated by having server side script as follows:

    Main.asc //for recording a livestream


    Client.prototype.startRecording = function()
    {
    trace("in StartRecording");
    this.streamObj = Stream.get(this.recordStream);
    if(this.streamObj)
    {
    this.streamObj.onStatus = function(info)
    {
    trace("in onStatus");
    trace(info.code);
    }

    this.streamObj.record();
    this.streamObj.play(livestream,-1,-1);


    }
    }

    application.onAppStart = function()
    {
    trace("The Application that is connected to is: " + application.name);
    trace("The FMS server that is connected to is: " + application.server);
    _clientId = 0;
    livestream = null;
    }

    application.onStatus = function()
    {
    trace("Some error surfaced somewhere");
    }

    application.onConnect = function(clientObj)
    {
    this.acceptConnection(clientObj);

    }

    application.onPublish = function(clientObj, streamName)
    {
    trace("Stream Name returned to onPublish is: " + streamName.name);
    livestream = streamName.name;
    clientObj.recordStream = "mp4:serverStream.f4v";
    // clientObj.recordStream = "serverStream" + _clientId;
    _clientId++;

    clientObj.startRecording();

    }

    application.onDisconnect = function(clientObj)
    {
    //s.record(false);
    }

    application.onAppStop = function()
    {

    }


    Once the recording is finished, just copy the recorded file into the media folder under the vod directory and now, this file is ready for streaming !
    Participating Frequently
    July 20, 2009

    Thanks for this post, helped out a great deal.  I have the authentication add-in installed and want to store the file name as the username.  Do you know how to pull the authenticated user's username?

    Thanks!

    Inspiring
    July 7, 2008
    I'd like to know the answer as well.