Skip to main content
June 1, 2008
Question

Best practice for streaming video with quickly (2-5 sec) changing sources

  • June 1, 2008
  • 2 replies
  • 333 views
Hi!
In my flex app I have a videodisplay, which should change its source every 2-5 seconds to an other clip (and or an other playhead time). Im trying to reduce the buffering times between the source changes, so that the resulting video plays without interceptions. To reduce the buffering times i've tried multiple video instances which preload its new source while an other instance is playing its clip.

Are there better ways for doing this? Could SMIL be a solution?

Thanks!

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Participating Frequently
    June 2, 2008
    There are several ways you can do this:

    1) If you really want to just reduce buffer times, while continuing to switch clips manually, you can use the "2-phase buffering" approach that developers commonly use to reduce startup times. Just before you switch, set the buffer size to something very small (0.5 secs is common). This will allow the buffer to fill rapidly. When you get the buffer full status event, set it to something more stable, like 2 secs, or 5 secs. Note that there will always be a small gap in playback with this approach, but that may be acceptable for your app.

    2) Use client-side playlists. You can add your short clips to the playlist using NetStream.play(reset=false). Each one will play in turn, with no gap in between. This is a very powerful technique, but it does require you to know somewhat in advance what clips needs to be added to the list. If you need to switch immediately, you'll still end up with a small gap in playback.

    3) Flash Player 10, in combination with an upcoming release of Flash Media Server, will support a feature called "Dynamic Streaming" that will allow for seamless transitions between clips, with very little latency. This may not help you out right now, but be on the lookout for it!
    June 2, 2008
    It seems better than SMIL file to me.