Skip to main content
August 20, 2011
Question

Save live streams in fragments

  • August 20, 2011
  • 2 replies
  • 1262 views

I'm planning to have a livestream running 24/7, and to be able to handle the high amounts of storage I need, I want to save the live stream in fragments (By size. For example: each fragment will be 1GB).

How can I do this on the server-side?

    This topic has been closed for replies.

    2 replies

    August 24, 2011

    Is it possible maybe to record the stream twice at once? (2 files)

    Adobe Employee
    August 24, 2011

    Yes.

    And regarding your previous question,

    That’s just one of the suggestions. One thing for sure, whatever method you try, that is going to be using SSAS.

    August 24, 2011

    I'll try to do what you suggested, but the dropping frames thing sucks.  I really hope the FMS team will come up with a solution for this subject.

    Adobe Employee
    August 20, 2011

    I am assuming that you want fragments of flv/f4v files. In that case you can use the stream.record() method on server side and specify the file size as parameter (which is optional and unlimited by default).

    However the recording will stop after the size limit is reached so you will have to look for the "NetStream.Record.DiskQuotaExceeded" status in stream.onStatus() callback and restart the recording.

    More details here http://help.adobe.com/en_US/flashmediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7e42.html#WS5b3ccc516d4fbf351e63e3d11a11afc95e-7f35

    August 20, 2011

    But then the stream will gap, isn't it?

    Maybe there is a way to configure FMS to record into files like that?:

    • Record 0001.flv for 100MB.
    • When 100MB is completed -- move to 0002.flv
    • Record 0002.flv for 100MB
    • When 100MB is completed -- move to 0003.flv
    • etc.
    Adobe Employee
    August 21, 2011

    Yes. Some frames 'might' be missed between the two recordings.

    For the scenario you mentioned, FMS doesn’t provides any such config. You will have to write SSAS to achieve that.

    One option could be to use the maxDuration parameter of stream.record() method.

    That ways at least you know when your recording is going to stop and then you can use setInterval() function to time your next recording.