Skip to main content
Known Participant
December 20, 2007
Question

Recorded data-only stream and buffer time

  • December 20, 2007
  • 2 replies
  • 575 views
I ran into an interesting problem. My application records a data-only stream (via FMS 2.0) which contains various events that occur during a session. During playback, if I don't set a buffer on the Netstream object on the client, for the most part, the events get triggered at proper times. However, if I do set a buffer (and I tried values from 5 to 100 seconds) a certain number of events just don't get triggered from the data stream. The greater the buffer, the more events are skipped. I would ideally like to have a buffer.

Is this a bug, or is this one of those aggravating and perplexing 'features' of flash's stream implementation?
    This topic has been closed for replies.

    2 replies

    Inspiring
    January 11, 2008
    Well, I don't know the exact details about your implementation, so its kinda hard for me to recommend you a solution. But, based on what you have written:

    quote:

    Originally posted by: DanielKozimor

    During playback, if I don't set a buffer on the Netstream object on the client, for the most part, the events get triggered at proper times. However, if I do set a buffer (and I tried values from 5 to 100 seconds) a certain number of events just don't get triggered from the data stream. The greater the buffer, the more events are skipped. I would ideally like to have a buffer.

    I


    Why do you still want the buffer if doing so is causing you problems?
    I already explained above, that buffering will cause you synch problems because of the data stream's nature and size. Also, if your stream is 500k or even 1Mb, if you stretch that over the playback length of a 10 min video, you dont really need any buffering, loading 1MB over 10 mins would be an easy task for any computer, even at very low connection speeds.

    Here is another idea:

    Instead of recording a data stream, why dont you setup a timer during recording on the client, and put together an xml file containing event-timestamp records, then at playback you could have another timer and trigger those events at proper times

    or just record your data along with the flvs

    Inspiring
    December 22, 2007
    Since there is no video or audio data, buffering is not necessary. However, if you are trying to synchronize these events with some other media that required buffering, for example a video, I'd say you buffer only the video and then play your data stream when the video starts playing. You can monitor when your video starts playing using the onPlayStatus or onStatus events. Then again, don't rely on buffering for your data stream, you don't need it, think of it as a blank video with no data just cuepoints. If you buffer it, your buffer will fill in less than a second (it doesn't matter if you set the buffer time to 10 days).
    Known Participant
    December 22, 2007
    quote:

    Originally posted by: GenaroRG
    If you buffer it, your buffer will fill in less than a second (it doesn't matter if you set the buffer time to 10 days).


    Thanks for the reply.

    The stream itself isn't that small - the one I used for testing was around 500KB and that one recorded a fairly short session. The stream could easily be much larger than that. Why wouldn't it make sense to buffer a certain amount of that data? It doesn't look like a trivial amount of data to me.

    I guess I'm not too clear how Flash and FMS handles pure data streams, or on the reasoning behind the current implementation.