Accessibility

Flash Communication Server Article

 

Optimizing Video Streaming with Dynamic Buffering Strategies


Tim O'Hare

Tim O'Hare

Flash Developer
www.scrippsnetworks.com

Table of Contents

Created:
25 July, 2005
User Level:
Intermediate

Streaming video over the web works wonderfully when bandwidth issues don't limit the user's viewing experience. To make sure your video streaming works optimally for your audience, there are several variables you need to manage: the user's bandwidth, the video bit rate, the video length, and the buffer time of the stream.

You may have seen or heard of scenarios where a user's connection speed is dynamically detected and then served a specific stream based on the size of the bandwidth. (See Stefan Richter's article Delivering Flash Video: Dynamic Bandwidth Detection with Macromedia Flash Communication Server.) In this scenario, Flash Communication Server (FCS) serves the user an appropriate video from an array of videos with multiple bit rates, based on the connection speed it detects. This way, high-bandwidth users receive high bit-rate video, and low-bandwidth users receive low bit-rate video.

In this tutorial, I approach the bandwidth issue in a different way: I stream one high bit-rate video to the user, but set a dynamic buffer time on the recorded stream. To accomplish this task, you will need to retrieve three variables: the user's connection speed, video bit rate, and the video length. You will then use an equation to determine the appropriate buffer time for your high bit-rate video. The goal is to show that high bit-rate videos can still be streamed to low-bandwidth users by calculating the buffer time accordingly. The user will see a seamless video stream while only having to experience one buffering session at the beginning.

I have provided sample files for you to use while working through this tutorial. There is an FCS_applications folder for use on your local or remote FCS installation and a SourceFiles folder containing all the necessary application files which will be used to help finish this sample application. For this tutorial, I assume you are using a local version of FCS. I have also provided a completed working application for your reference.

Note: This tutorial uses Stefan Richter's tutorial, Delivering Flash Video: Dynamic Bandwidth Detection with Macromedia Flash Communication Server, and server-side scripts to detect the user's connection speed.

Requirements

To complete this tutorial you will need to install the following software and files:

Flash Communication Server

Flash MX Professional 2004

Tutorials and sample files:

About the author

Tim O'Hare is a Flash developer for Scripps Networks, the parent company of HGTV, DIY Network, Food Network, Fine Living, HGTVPro.com, Shop at Home and Great American Country. His responsibilities are centered on the development of Flash applications for many of the Scripps Networks online properties.

Before Scripps Networks, Tim worked for many multimedia development firms within the Knoxville, Tenn., area. He also spent one year teaching Flash and Director development for ITT. Tim has a BFA in graphic design and spent five years pole vaulting for the University of Tennessee track and field team.