Skip to main content
Participant
February 15, 2013
Question

How to record streams in the /live folder of ams 4.5 like you do in fms 3.5.

  • February 15, 2013
  • 1 reply
  • 448 views

I have an old version of fms 3.5 which allows you to record streams into the /live folder when using fmle. I am testing with ams 4.5 by sending to the /live folder but the server is not recording like it does in 3.5. How do you accomplish this in ams4.5?

Thanks

    This topic has been closed for replies.

    1 reply

    February 15, 2013

    You can not record a stream under live application folder. You can record a livestream by doing a server side record. Following are the steps:

    1. Create a folder called record_app under applications folder.

    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);

      pubCount++;

      if(pubCount == 1)

           streamObj.record("record");

      else

           streamObj.record("append");

    }

    application.onUnpublish = function(clientObj,streamObj){

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

    streamObj.record(false);

    }

    3. If you're using FMLE to publish then make a rtmp connection to app record_app and then publish as : mp4:sample.mp4, then the stream sample.mp4 will be recored..