Creating Video and Audio for the Web

Creating high-quality audio and video for the Web can be a challenging process. It almost always requires third-party tools and the knowledge of how to use them. This section focuses on some of the general concepts behind media creation, and not on the specific techniques used in a particular editing product.

Creating Video

There are many different ways to get video onto your computer. You can buy Video capture cards, products that allow video from a camera, VCR, or other video source to be read onto a computer. Some TV tuner cards come with software that captures TV video. You can also buy CDs that contain video clips. Once video is on a machine, an editing tool such as Adobe Premiere can be used to modify it, mix it with other video, or add sound and professional effects. You can also use video-editing tools to build a video from scratch.

Digital video is frame-based. Traditional film works by moving still frames past a lens at a rapid rate, usually 24 frames per second. Computer video works on the same principle. The video player displays a series of still frames on the screen in succession. On a computer, however, the developer can control such details as the frame rate.

Video File Size

Video creates some of the largest files on the Web. A 1-minute video file can use as much space as the total text of dozens of full-length novels. Many factors affect video file size, including choice of codec, video dimensions, frame rate, color depth, and the quality of any included audio. Let's look at each factor to see how it can affect the performance of your video files.

CODECS For video to work on the average computer, it must be compressed when it is created and decompressed when it is played back. This is because the file for an average 24-bit image, 640 pixels by 480 pixels, is roughly 900 KB. This means that a 30-second video played at only 15 frames per second would use 450 images and would be 405 MB in size (approximately the size of 800 books, each containing 100,000 words). To play this video back, a computer would have to display 13.5 MB of data every second. This is too much for the average computer to handle, and these numbers represent thousands of times more capacity than that of a modem.

To solve this problem, most video files are compressed to reduce file size and improve performance. A codec (short for compressor decompressor) controls the type of compression and decompression to be used. Put simply, a codec allows video to be saved in a much smaller file by finding patterns in the video and not saving repetitive information. When the video is played back, the codec restores the pieces originally removed and re-creates the original video, or a reasonably close facsimile thereof, on the screen.

The codec that is chosen has a profound effect on the file size and quality of the video. Some of the codecs available include: Cinepak, Intel Indeo, RLE, Video 1, and MPEG. Some of these are included by default with the Windows Media Player. Different codecs should be used for different kinds of video. A detailed discussion of codecs is beyond the scope of this book, but generally, "lossy" formats, such as Intel Indeo, are better for video of "real-world" objects like trees and people, while "nonlossy" formats, like RLE, are better for animations of screenshots and video with a small number of colors. As with many techniques on the Web, experimentation may be the key to finding the best tradeoff between quality and file size.

NOTE
A word of warning: Because a codec governs both compression and decompression, the computer that requests your media file must use the same codec to decompress that you used to compress the file. If you use any nonstandard codecs, you will need to tell users where they can get a copy of the codec you used. The most standard codecs include RLE, MPEG, and Cinepak. A list of all the codecs available on a particular Windows 98 system can be found in the Control Panel for Multimedia, on the Devices tab, under Video Compression Codecs.

DIMENSIONS In video, the larger the picture dimensions, the more information the computer must display on the screen. That being the case, smaller video dimensions result in smaller file size and better playback. As a general rule, you should use the smallest video dimensions you can reasonably get away with. This is especially true on the Web. It is also important to understand that many video codecs work more efficiently if the video maintains a 4:3 aspect ratio; in other words, they are 4 pixels wide for every 3 pixels in height, or vice versa.

While 640 x 480 and 320 x 240 pixel videos are fairly common in games or on CDs, they produce very large files and are all but unusable on the Internet. Smaller sizes like 160 x 120 can work over the Net, but 120 x 80 or 80 x 60 usually work better.

FRAME RATE Frame rate, measured in frames per second (FPS), is one of the most important considerations when creating video, especially for low-bandwidth situations. Higher frame rates usually require more data to be displayed, and low bandwidth equals a low data rate. Television broadcast-quality video runs at 30 FPS. Unfortunately, you will not get your video transferred over the Internet at anywhere near that frame rate under any but the most favorable circumstances. A frame rate of 7 FPS is generally considered "rock bottom" for motion video. A good compromise is 10, 12, or 15 FPS, but any video with a frame rate below 7 FPS will look more like a slide show than a video. Some formats are less affected than others are by frame rate. Most properly optimized animated GIF files will not increase noticeably in size when the frame rate is increased. Unfortunately, GIFs also offer the least assurance that a video will actually display at the desired rate and offer no options of embedded synchronized audio.

COLOR DEPTH The number of colors used in a video is expressed as color depth (also known as bit depth). For most digital video, the optimal color depth is 24-bit, or "true color" (16.7 million colors). A somewhat common color depth for home computers, however, is still 8-bit or 256 colors. If a 24-bit video is played on an 8-bit monitor, the codec will dither the video to 256 colors. Dithering is the process of reducing a high-color image or video to a lower-color image or video by finding the closest match in the available palette of colors—with the result that parts of the images might not appear as originally intended.

Designers often develop a specific color palette for their content and may want to apply that palette to their video to ensure that it will look as expected, no matter where it is played. Several codecs, such as RLE and Video 1, allow the creator to specify a particular palette during the compression of a video. Interestingly enough, as a result of the way codecs work with colors, palletized video files (reduced to 256 colors) are frequently much larger than 24-bit video files (16.7 million colors).

AUDIO QUALITY You'll find the details of audio resolution in the next section. However, when considering video file size, you should also be aware of audio issues. Video files often contain audio content, and high-quality audio often results in larger video file sizes.

Creating Audio

Audio technology has improved dramatically since the advent of the multimedia computer. Great strides have been made in reducing file size and improving quality. We can only touch on some of the basics here, but you can learn a great deal more about digital audio from the audio-editing software documentation and from books on the subject. Two suggested titles are listed below.

The Art of Digital Audio by John Watkinson (Butterworth-Heinemann, 1994).

Principles of Digital Audio by Ken C. Pohlmann (McGraw Hill, 1995).

One measure of digital audio quality is resolution. Audio resolution consists of two parts: bit depth and frequency. Most audio editing tools allow you to set the bit depth and frequency of the audio you create. Generally speaking, the higher the numbers, the better the quality. CD quality audio has a bit-depth of 16, a frequency response of 44,100 Hz, and typically has two channels of audio, for stereo. Before compressing audio for use on the Web, it is often helpful to reduce it to a lower resolution, for example, to 8-bit, 22,050 Hz (or even 11,025 Hz), mono (single channel).

Audio Codecs

The audio compression scheme you use will have a dramatic effect on the final result. You can choose from among many codecs: PCM, Lernout & Hauspie, ADPCM, IMA ADPCM, MPEG layer 3—and the list goes on. There are no hard-and-fast rules about which codec to use, so you will need to experiment. You'll generally find a trade-off between the amount of compression provided and the resulting quality of the audio.

Audio Software

Compression is typically handled by sound-editing tools. Some popular tools include:

Product Available From Notes
Sound Forge Sonic Foundry. Contact www.sonicfoundry.com for more information Very flexible and powerful editing tool.
CoolEdit Shareware sites. Both a shareware and a commercial version of this product exist.

This chapter introduced the use of media on the Web. The next chapter will cover a range of more specific tools such as basic multimedia HTML tags, the Media Player (ActiveMovie) Control, and the Interactive Music Control.



Dynamic HTML in Action
Dynamic HTML in Action
ISBN: 0735605637
EAN: 2147483647
Year: 1999
Pages: 128

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net