Skip to main content
Known Participant
September 5, 2010
Question

Record Live Stream

  • September 5, 2010
  • 1 reply
  • 667 views

Hi,

I'm using the following code to record a live stream (server side code):

application.onPublish = function (p_c, p_stream)

{

trace("onPublish stream: "+p_stream.name);

p_stream.record();

};

I have two questions:

1) can I change the name of the FLV I am recording at the serve side? For example, if the stream is Stream_A, and I want to create a StreamFile.Flv.

2) How can I add a timestamp to the metadata of the video when the onPublish function is called? I need to do it at the server side of my application.

Thanks

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    September 5, 2010

    1) application.onPublish = function(clientObj,streamObj){

      var s = Stream.get("StreamFile");

      s.record("record");
      s.play(streamObj, -1, -1);
    }

    2) I dont know how we can do it on server side but from the publisher like FMLE you can insert timecode using "Timecode" option and then retrieve using following handler ( http://help.adobe.com/en_US/FlashMediaLiveEncoder/3.1/Using/WS5b3ccc516d4fbf351e63e3d11c104ba9cd-7ffe.html ) :

    ns.onFI = function(infoObj){
        var timecode:String; // Timecode generated by capture device
        var systemDate:String; // System date "sd" embedded by Flash Media Live Encoder
        var systemTime:String; // System time "st"embedded by Flash Media Live Encoder

        for( i in infoObj)
            {
                if(i == "tc")
                timecode = infoObj.tc; //string formatted hh:mm:ss:ff
            
                if(i == "sd")
                systemDate = infoObj.sd //string formatted as dd-mm-yy
            
                if(i == "st")
                systemTime = infoObj.st //string formatted as hh:mm:ss.ms
            }
    }

    Regards,

    Amit