Skip to main content
January 22, 2013
Question

Capture the live stream and than play it as vod

  • January 22, 2013
  • 1 reply
  • 577 views

Hi guys,

Could anyone explain how can I record the live stream and than play it as a vod at later time?

Is it possible to achive it?

Can you give any tips guys?

    This topic has been closed for replies.

    1 reply

    January 23, 2013

    Hi Mark,

    You can record a livestream by doing a server side record in you application. For example :

    1. Create a folder called test under applications

    2. Within this folder create a main.asc in any text editor and add :

    var pubCount = 0;

    application.onConnect=function(clientObj){

              trace("          on connect ");

              return true;

    };

    application.onDisconnect=function(clientObj){

              trace("          on disconnect "); 

    };

    application.onPublish = function(clientObj,streamObj){

      trace("          in application publish : " + streamObj.name);

      if(pubCount <= 1)

           streamObj.record("record");

      else

           streamObj.record("append");

      pubCount++;

    }

     

    application.onUnpublish = function(clientObj,streamObj){

    trace("on unpublish : " + streamObj.type + ":" + streamObj.name);

    streamObj.record(false);

    }

    3. You can then publish a stream with the container. If you're using FMLE publish as : mp4:sample.mp4, then the stream sample.mp4 will be recored.

    You can then either host the recorded stream directly in AMS and use as vod file or run the post processor tool f4vpp and use it to play in vlc or other players.

    Hope this hepls. Let me know if you have any other query.

    Thanks,

    Apurva

    January 23, 2013

    Thank you very much. I have created the main.asc file and the recording works.. but I have another question. If I start the new live stream.. it is saved to the file with the name stream. If I start another stream with the same name the first one is overwritten. Is there any way to prevent this?

    Do you know how can I list recorded streams via api?

    Also, while starting the new streaming I'm seeing errors as follows:

    Sending error message: Method not found (releaseStream).

    Sending error message: Method not found (FCPublish).

    Do you know what could cause this?

    Regards