Like audio, video clips were linked to web pages in the Web's earliest days. Delivering video via the Web is especially problematic because video files require huge amounts of data to describe the video and audio components, making for extremely large files. Few people will sit and wait an hour for a couple of minutes of video fun.
Many of the same technologies that have improved the experience of receiving audio over the Web have been applied to video as well. As with audio, you have the option of simply linking a video to your web page for download and playback, or you can choose from a number of streaming solutions. "Streaming" means the file begins playing almost immediately after the request is made and continues playing as the data is transferred; however, the file is never downloaded to the user's machine. For a more complete description of streaming versus nonstreaming media, see Chapter 24, "Audio on the Web".
Many of the principles for developing and delivering video content for the Web are the same as those for audio (in fact, some of the file formats are the same as well). This chapter introduces you to basic video technology and concepts, including introductions to the video file formats QuickTime, RealMedia, Windows Media, AVI, and MPEG. If you are interested in learning how to produce video files for the Web, the books listed at the end of this chapter are a good start.
The following is a list of aspects of digital video that can be manipulated with standard video-editing software. It is important to be familiar with these terms so you can create video optimized for web delivery.
It's a simple principle -- limiting the length of your video clip limits its file size. Videos longer than a minute or two may cause prohibitively long download times. If you must serve longer videos, consider one of the streaming video solutions.
Obviously, the size of the frame has an impact on the size of the file. "Full-screen" video is 640 480 pixels. The amount of data required to deliver an image of that size would be prohibitive for most web applications. The most common frame size for web video is 160 120 pixels. Some producers go as small as 120 90 pixels. It is not recommended that you use a frame size larger than 320 240 with current technology. Actual size limits depend mostly on CPU power and bandwidth of the user's Internet link.
The frame rate is measured in number of frames per second (fps). Standard TV-quality video uses a frame rate of 30 frames per second to create the effect of smooth movement. For the Web, a frame rate of 15 or even 10 fps is more appropriate and still capable of producing fairly smooth video playback. For "talking head" and other low-motion subjects, even lower frame rates may be satisfactory. Commercial Internet broadcasts are routinely done as low as 0.5, 0.25, or even 0.05 frames per second (resulting in a slideshow effect rather than moving video).
Many video-editing applications allow you to set the overall quality of the video image. The degree to which the compression algorithms crunch and discard data is determined by the target quality setting. A setting of Low or Medium results in fairly high compression and is appropriate for web delivery. Frame rate and quality are often traded off in different degrees in relation to each other, depending on the application, to reduce bandwidth requirements.
The size of the video is affected by the number of pixel colors in each frame. Reducing the number of colors from 24- to 8-bit color will drastically reduce the file size of your video, just as it does for still images. Of course, you also sacrifice image quality.
This is the rate at which data must be transferred in order for the video to play smoothly without interruption. The data rate (also called "bit rate") for a movie is measured in kilobytes per second (K/sec or Kbps). It can be calculated by dividing the size of the file (in K) by the length of the movie (in seconds). So, for example, a highly compressed movie that is 1900K (1.9 MB) and 40 seconds long has a data rate of 47.5K/sec.
For streaming media in particular, a file's data rate is more important than its total size. This is due to the fact that the total bandwidth available for delivery may be severely limited, particularly over a dial-up connection. For example, even an ISDN line at 128 Kbps offers a capacity to deliver only 16K of data per second.
Copyright © 2002 O'Reilly & Associates. All rights reserved.