Skip to main content
Participant
Jul 5, 2008 8:59 AM UTC
Question

Record Live Stream with FMS3

How do I record a live stream in FMS3 and make the recorded streams available in the VOD folder?
    This topic is closed to new replies. Start a new post to keep the conversation going.

    5 replies

    Participating Frequently
    Jul 7, 2008 11:41 AM UTC
    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 !
    Translate
    Participating Frequently
    Jul 20, 2009 10:17 PM UTC

    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!

    Translate
    Inspiring
    Jul 7, 2008 4:19 AM UTC
    I'd like to know the answer as well.
    Translate