Skip to content.

Orange Journal

Sections
Last modified February 01, 2006 at 07:07 PM

Streaming Media: 2

Tim Dereg
This article discusses compression/decompression techniques and the issues that must be addressed when compressing video data.

In this article:

Video Compression

The audio and video information that you see on your television, with all its color, detail, and sound, represents an enormous flow of data. Current network architecture cannot process this amount of data over the internet fast enough to render it into a full-screen, television-style presentation on your computer monitor. In addition, any file being streamed to your monitor must be transferred at a rate that your modem can handle. This slow data rate means that the streaming media can be displayed only in a small window if it is to be displayed in anything close to realtime.

To make the best use of this slow data rate, the video and audio information must be compressed. This compression occurs through the use of codecs (compressor/decompressors), which are basically mathematical formulas, or algorithms, that reduce the amount of data within each frame.

There are many different types of codecs, and they each have their own strengths and weaknesses. The two most widely used groups, or families, are designed for either a Windows-style or a Mac-style environment, although some codecs are cross-platform compatible.

  • Codec formats for Windows-type operating systems include Indeo 3.2 and Cinepak, and the international standards MPEG-1, MPEG-2, MPEG-4, H.261, and H.263. The various MPEG formats are discussed in Compression Formats .
  • Codec formats for Mac computers, such as QuickTime 4. One of the strengths of QuickTime 4 is that it supports a wide array of video, audio, text, MP3, Flash, and its own brand of MIDI music.

The physical dimensions of the window in which streaming media appears, and the quality of the video and audio, are the result of the type of codec that is used to compress the data and the level of quality you choose for the finished file at the time the data is compressed.

Some codecs reduce file sizes through certain data compression techniques where no data is lost and is termed lossless compression. The most widely used codecs, however, reduce file sizes by discarding data. This technique, termed lossy compression, compares two successive frames and determines the differences between them. If two successive frames are identical (meaning that the second frame has exactly the same information as the first frame), all the data for the second frame can be safely discarded without degrading the quality of the video. For this reason, a compression algorithm typically reaches its highest compression rate when there is no change at all in the video or audio data between successive frames.

When a change is detected, such as motion or a change in camera angle, the codec stores the detected change in the file so that the difference can be recreated when the file is decompressed and played. A video that has only a small amount of change from frame to frame, such as a 'talking head shot' against an unmoving background, can be compressed to a much smaller size than, say, a video of a parade or a video that includes a series of shorter video clips. In these situations, data that would otherwise contribute to better audio, smoother onscreen motion and sharper details must be discarded in order to reduce the file size. This will lower the quality of the presentation and result in an objectionable level of 'jerkiness' and harsh audio as the file is played.

In compressing a file, you must ask yourself "how much data can the codec throw away before the video is basically unwatchable?" To reduce the size of a file, you can:

  • Reduce the quality of the video,
  • Reduce the size of the display window the video will play in,
  • Reduce the number of frames per second that are shown.
  • Reduce (or eliminate) the fine details
  • Reduce the quality of the audio
  • Or, most commonly, perform all of the above and then reduce it even more.
Last modified February 01, 2006 at 07:07 PM

Personal tools