Skip to main content
June 29, 2011
Question

Setting file name of captured file in DVRcast application

  • June 29, 2011
  • 1 reply
  • 970 views

I've looked through the scripts in the scripts/ directory, but haven't seen anything obvious.

I would like to be able to specify the file name to capture the stream to. At present, the capture file is always named the same as the stream, which means if I stream for a bit, stop, then restart, the originally captured file gets overwritten. I'd like to be able to incorporate something, i.e. the stream start time, into the capture file name.

Pointers to where I can do that?

    This topic has been closed for replies.

    1 reply

    Nikhil_Kalyan
    Participating Frequently
    June 29, 2011

    Hi,

    I didn't entirely remember the DVRCast application and its various files, but there should be some code which is similar to below :

    s = stream.get("recorded_file_name");

    s.record();

    s.play(streamName.name);

    Essentially, we are taking the FMLE published stream into StreamName.name , which is now passed to a variable s, this is made through Stream.get.

    Whatever file that is being recorded will get the name from what is given in Stream.get. See if you can find and , probably you should be able to add your own logic to make it unique.

    Hope it helps. Thank you !

    June 29, 2011

    Ok, I see that, thanks! It's in ExDVRStream.asc which is loaded by main.asc.

    Now it should be pretty simple to make the changes I need to make.

    I might also need to do some looking at the stream to figure out whether I need to set the format to mp4 or flv. My customers will be streaming VP6&mp3, H.264&mp3, and H.264&AAC. The default dvrcast code handles the first two just fine, but chokes on the H.264+AAC streams unless the customer appends "mp4:" to his stream name. Some of my customers won't be able to figure out how to do that, so I'd like to be able to examine the stream to figure out how to handle it. I am fairly familiar with Wowza's API, but know nothing at all about FMS's API. Could you point me to some docs where I could find that info?

    Message was edited by redcat60440 to correct a dumb typo

    Nikhil_Kalyan
    Participating Frequently
    June 29, 2011

    Good that you found the previous issue solved

    For me, the best always is to go for mp4 format irrespective of the encodings. MP4 can support VP6/H264/MP3 and AAC.

    And for FMS to record a file in mp4/f4v format, you need to prefix a mp4: to the stream name while publishing and/or recording. This "mp4:" mentions the FMS to load the mp4 module and all the stream actions are now under its control.


    It is a general usage that for VP6-MP3 we go for FLV format (for which no prefix is needed) for H264/AAC , we go for MP4. But as I said, MP4 can serve all your purposes.

    There are no APIs as such on FMS that I can think of , to do this. All you need to do is to add the prefix or not. It can be controlled either through a good client logic or , can be totally eliminated by having a singular structure.

    Hope this also helps you for your work , Thank you !