Logo link to Tomontheweb.ca
Flash Server

Streaming Video: An Overview

Data Rates

When video is shot down the garden hose there is a very real risk that you have attached the hose to a fire hydrant. If you don't control the data flow, you will open yourself to a "world of hurt".

The data rate for video is not tied to bandwidth. It actually relates directly to the spin rate of a CD. For example, the base spin rate for a CD in your computer is 150 RPM.This means the computer can read about 150 kb from the CD each second. How fast the CD spins determines how fast the data is "streamed" from the CD. If you have a CD player included in your computer, the odds are very good that it is a 24X or even 48x player. This means when you play a video from a CD, the data rate can reach 3,600 kb/sec or 7,200 kb per second if the drive is rated at 48X. This works fine in theory.

When it comes to digital video on a hard drive or CD there is a real disconnect between how the computer works with it and how digital video actually works. Your computer does not access a video in a straight line. The "head" moves all over the CD or the hard drive looking for the necessary information. This takes time. Then the information is decompressed which takes more time. Then more time is used putting the information on the screen. If you subtract all of that time, you will be lucky to have an optimal data rate of two-thirds of the information needed at any point in time. The point here is never optimize the data rate to the drive speed or the web connection. You will have problems.

Video speeds

Image 6: When working with video destined for internet playback, a data rate based on 3x and 4x is a good starting point.

It is safe to assume playback is also dictated by the size of the file, how many frames per second are played and the compression used. The bottom line is not to make any assumptions other than the lowest common denominator.

When dealing with internet bandwidth, a number of other factors come into play. They range from the connection speed to the physical size of the video.

Meet the CODECS

Compression and decompression are accomplished by a set of mathematical calculations called a codec. Codec is an acronym for "COmpressor/DECompressor" or enCODer/DECoder . Codecs compress data as it is encoded and decompress it for playback. In order for a video to be played it must be decompressed by the same codec used to compress the video. This explains why, in certain instances, you are asked by your computer to find a codec for a video you may want to watch.

Video and audio codecs work differently. The video compressor will compress the imagery and the audio compressor will compress the sound. In Flash, the ON2VP6 and Squeeze codecs both use Fraunhofer compression for the audio track. This compressor is the standard for creating audio MP3 files.
The most common video codecs are:

Codec List

Image 7: This is a listing of the Codecs available in QuickTime Pro.

If you are going to be creating an FLV, the absolute best CODECs for the file given to you are the lossless codecs such as "Animation", Video" or "Graphics". They are lossless which is a “good thing”. Running a QuickTime movie through the Flash Video Encoder 8 means you will be using a “Lossy” codec.

The lossy codecs - Sorenson and ON2VP6 are examples- essentially scoot through your video looking for frames that are quite similar to each other. Then it notes those similarities in a type of shorthand. An example would be a video a logo in the upper left corner for the first sixty frames. The codec looks at this and says, "Hmm, that upper left corner is the same for 60 frames." It then notes the first frame containing the logo and ignores it for the next 59 frames. The result is a file that is significantly smaller than had the logo been drawn in all 60 frames. From this you can now start to understand the difference between a key frame and a difference frame. When a lossy codec is used, the frames in the video track are, in very simple terms, composed of only the differences between frames.

What about the frames where everything is different? They have to be remembered and they are the key frames or the frames key to the differences between the frames. These codecs will ask you how frequently to produce a key frame. Though there is not one pat answer, one key frame per second is a good starting point. For example, if your movie is slotted to play back at a rate of 15 frames per second, one key frame every 15 frames is your starting point.

Codecs designed for streaming, such as Sorenson, ON2VP6 or MPEG-4, result in surprisingly small file sizes because the key frames are so spread out. Instead of one key frame every 15 frames for a movie playing back at a rate of 15 FPS, you can get away with a key frame every 30 frames or higher. With fewer key frames to "remember" there is a corresponding reduction in file size.

Keyframes

Image 8: Key frames have a profound effect upon file size.

...Next

photo Tom Green
Tom Green

Who is tom green?

Teacher, author, raconteur. Here's a run down of what I have been up to over the past few years. My Bio.

Class Files: