Skip to main content
Participant
September 23, 2006
Question

Playback of streaming flv(s) AND mp3(s) in sync?

  • September 23, 2006
  • 3 replies
  • 469 views
Hi!

I want to find out if it's possible to create a client flash app that allows
* playback of one or several audio channels (mp3s)
* playback one or several video channels (flvs)

These media channels should be played back in sync with each other, so that the audio channels can contain sound synchronized to the video channel(s)
I want to use streaming media because of the higher security-level (not storing the any temp media on the client computer)

Can this be done using the combination of Flash8 and Flash Media Server?

Any ideas or point of views are welcome!

Regards / Jonas Nyström
    This topic has been closed for replies.

    3 replies

    September 24, 2006
    The thing to understand about FMS streams is that there is no such thing as "fully loaded". The data is discarded as soon as it is played, or in the case of buffered data, as soon as the stream is paused, stopped, or seeked. There is no way to preload an FMS stream, short of setting the buffer time to the total length of the stream, and I imagine doing that will introduce client side memory problems (as in using it all up).

    In the end, I don't belive there is any way to sync FMS streams accurately.
    Jonas_NAuthor
    Participant
    September 24, 2006
    Thank you very much, Jay!

    What happens don't allow playback until all the streams are fully loaded?
    If so, is there a way to be sure of playback synchronization?
    (Of course I lose "core advantage" of streaming, but at least my media files are protected...)

    Jonas
    Jonas_NAuthor
    Participant
    September 23, 2006
    One more point:

    I realize it can be a problem starting playback when not all media files are downloaded. For me, that's not a problem - I can wait...

    / Jonas
    September 23, 2006
    I'm afraid that sync-ing FMS streams isn't really a possibility. There are a number of factors at play here, the primary ones being how the Flashplayer buffers streams, and the response time of the server.

    The (seeming) simple approach would be to monitior the buffer status of each stream, and pause all streams when the buffer of one of them is empty. The problem is that when you pause an FMS stream, the buffer empties. Let's consider the following:

    Stream A is an FMS flv stream
    Stream B is an FMS mp3 stream

    During playback, the buffer in stream A runs out, so your monitoring function pauses stream B. As soon as that happens, the buffer for stream B empties, so now stream A has to pause. When stream A is pause, its buffer empties, so now stream B has to pause again... and the cycle continues.

    We also have to consider that we can't be sure how long it will take for FMS to respond to the play command for any one stream, so we will likely be out of sync from the get-go.