Advertisment

Tech behind a Video Clip

author-image
PCQ Bureau
New Update

From Desktop Publishing (DTP), we’ve now reached the age of Desktop Video

(DTV). For years, it had been impossible to edit videos for home or office use because of the high cost of hardware. The scene’s changed now, and almost suddenly, it’s not only possible but also affordable to capture and manipulate videos right on your desktop. Here, we’ll introduce you to the technology that makes Desktop Video possible. In a separate piece (see “Capturing Video”, page 97) in this issue , we’ll look at some of the exciting things you can do using low-cost video capturing devices. So let’s get started.

Advertisment

When working with video, there are two areas of concern. The first is compression, and the second is the program that can play back the compressed video. There are many methods of compressing video, called codecs. The playback programs in turn support one or more codecs. 

Compression does the trick



The main problem with video is that it’s enormous. Just to give an idea of what I’m talking about, here are a few interesting numbers. one second of uncompressed 24-bit, 640x480 video and its associated audio fills about 30 MB of disk space. So, to produce a 20-minute video sequence, you would require approximately 36 GB of real estate. Even if you had big enough hard drives, most PCs can’t move 30 MB of data per second. For today’s PCs, a throughput rate of 5 mbps is considered pretty fast. So, just imagine trying to move these massive amounts of data through a CD-ROM drive or over the Internet. 

The only way a computer can deal with video is by compressing it. Special video compression algorithms called codecs (compression/decompression) make such compression possible. These reduce the file size dramatically, while retaining acceptable quality. They work by exploiting the similarities between adjacent pixels and using smaller code words to encode a block of similar pixels. For example, when you digitize the image of a blue sky, there’ll most likely be thousands of shades of blue color in it. The compressor takes those thousands of colors and makes them into one–in this case blue. This is referred to as intra-frame compression, because compression is limited to within that frame. Once each frame’s been compressed, they’re simply put together to create the movie. JPEG is an example of such a

codec.

Advertisment

Another commonly-used method of compression is inter-frame compression. Here, once individual frames have been compressed, the compressor seeks a way to capitalize on redundancies between consecutive frames. This is called frame differencing. Frame differencing uses key frames–a frame in which all the data for that frame is stored. A key frame is self-contained–it doesn’t rely on other frames. Differenced frames are based on a particular key frame, and store only that information which is different from the key frame. So, you have key frames at regular intervals and subsequent differenced frames that rely on the key frame they’re associated with. Obviously, this is most effective when there’s little change between frames and least effective when large amounts of data change. The key frame rate is decided at the time of compression. It depends on both the frame rate and the quality of the end product, and is proportional to image quality and file size. If you reduce the frequency of key frames, it’ll reduce the file size, but image quality will suffer. This kind of compression is referred to as inter-frame compression, because compression is done not only on each frame but also between consecutive frames. MPEG is an example of such a

codec. There are many codecs available today, and each one has its own strengths and weaknesses. Some are good for storing videos, and some are more appropriate for still images. Some are good for playback off a CD-ROM and some from the Web. Each codec takes advantage of different properties of an image for compressing it. So, the type of material being compressed affects not only how much compression can be applied, but also how well the codec can reproduce the compressed content. 

Playing back the video



Architectures such as QuickTime and Video for Windows are system extensions and plug-ins that allow your PC to display video. Each of these architectures support different
codecs. These different architectures have a lot in common, but there are also quite a few differences. Some are dedicated to playback via the Web, while others are stronger at CD-ROMs. Some work only on a specific operating system. There’s no one best architecture, and choosing between them depends on your application and needs. Needless to say, a basic understanding of the capabilities of each will help you work better with video.

QuickTime



QuickTime is Apple’s multi-platform multimedia software architecture. QT is well-rounded, and is suited to delivery of media everywhere–the Web, CD-ROMs,

DVDs, kiosks and presentations. Both the MacOS and Windows are equally well-supported. QuickTime is widely used for putting movie clips on the Web, and now, with version 4, movies can be delivered via progressive download, or via true streaming. 

Advertisment

QuickTime is also the dominant architecture for CD-ROM video. It enjoys an impressive market share due to its cross-platform support, wide range of features, and free licensing. For these reasons, QuickTime is used on a vast majority of CD-ROM titles. DVD-ROM is similar to CD-ROM in many respects, so QT works fine here too.

Codecs supported by QuickTime include Sorenson Video,

Cinepak, Indeo3.2, Indeo Video Interactive 4, photo-JPEG and MJPEG among others (We’ll talk about these different kinds of codecs a little later). This means that if your video’s been compressed using any of these

codecs, it can be played back on any system which has QuickTime installed on it.

RealVideo



RealVideo (or RealMedia) is a Web-oriented, streaming media architecture developed by
RealNetworks. It offers both true streaming and progressive download. RealSystem G2 is the second generation of RealVideo and can deliver audio, video, and other media types such as text and Flash animations. It’s less suitable for CD-ROM or DVD delivery, because it requires high bandwidths, and therefore high CPU usage for video playback. Real files can’t be edited or re-compressed once they’re encoded into the Real format. It’s usually best for data rates below 3 kbps. 

Advertisment

To make RealMedia-based content available from your Website, you need to have RealMedia servers installed on your Web server. You can view RealSystem G2 movies with the RealPlayer, a free client application available from RealNetworks. The enhanced RealPlayer Plus provides additional features, and has to be purchased from RealNetworks. 

Windows Media technologies



Formerly known as NetShow, Windows Media is Microsoft’s streaming media architecture. Focused on network delivery of video and audio, Windows Media offers server-based true streaming as well as limited support for progressive download. NetShow servers support true streaming, and if the network’s performance degenerates, it’ll automatically send less video data (thus reducing the quality). If the amount of available bandwidth decreases further, it degrades video quality further, until only the audio is left. 

It supports the following codecs–MPEG-4, Vivo V263, VDOnet

VDOwave, Indeo3.2, and Indeo Video Interactive 4.1. The current release of Windows Media is version 4.

Advertisment

Video for Windows



The main advantage of Video for Windows (AVI files) is that it’s built into Win 95. However, it has many limitations. It runs on Windows only, doesn’t handle audio/video synchronization as well as QuickTime, and doesn’t support variable-length frames. Video for Windows is no longer supported by Microsoft, and is being replaced by DirectShow/ActiveMovie (one of the DirectX technologies). The AVI format is also being replaced, with ASF (Active Streaming Format). The main codecs supported are

Cinepak, Indeo 3.2, Indeo Video Interactive 4.1, MJPEG, Microsoft Video, and H.261.

DirectShow 



Formerly known as ActiveMovie, DirectShow is the successor to Microsoft’s Video for Windows architecture. It’s built on top of the DirectX architecture (along with DirectDraw, DirectSound, and Direct3D), for access to audio and video hardware on Windows-based computers. The playback media supported by it include the Web, CD-ROMs, and
DVD-ROMs. DirectShow has its own player (the Microsoft Media Player, implemented as an ActiveX control), which may be used independently or within IE. There’s also a plug-in for use with Netscape Navigator. 

VDOLive 



A streaming Web video architecture produced by VDO.net, the makers of VDOPhone. VDOLive uses wavelet compression to deal with decreased bandwidth. On a slow connection, it first lowers the number of wavelet bands each frame displays. Its next approach is to reduce the frame rate. Finally, it drops video altogether and delivers only audio.

Advertisment

VivoActive 



This is an offering from Vivo. Vivo was acquired by RealNetworks in February 1998, and this technology is now being incorporated into RealMedia. Because of this, the VivoActive format is likely to disappear in the future. 

You’ll find a comparison of the features of various architectures in the table.

That brings us back to the various video codecs.



Comparing architectures

Architecture Progressive download True streaming CD
QuickTime 3 3 3
RealMedia 3 3 X
Windows Media  3 3 X
Video for Windows 3 X 3
VDOLive X 3 X

Advertisment

Codecs all the way



Here are some of the commonly-used codecs that enjoy support from popular architectures.

Photo JPEG



The Photo JPEG codec implements the Joint Photographic Experts Group (JPEG) algorithm for image compression. It’s generally used for storing still images. It can also be used for compressing video at high quality. Photo JPEG works by breaking up the video into frames and compressing each frame separately. Once the frames have been compressed, they’re put back together to create a movie. As stated earlier, this is intra-frame compression. If you just want to capture video and edit it on your computer, JPEG may be all you need. However, JPEG isn’t the best choice for electronic distribution. Good JPEG movie files are too big to be efficiently stored on CD-ROMs or played back on the Web. Photo JPEG is supported by QuickTime and Video for Windows.

MPEG



MPEG (Motion Picture Experts Group) takes JPEG and adds inter-frame compression techniques, that is, it saves only the differences between frames. There are two accepted MPEG standards today–MPEG-1 and MPEG-2.

MPEG-1 



MPEG-1 provides excellent audio and video quality at 1x (150 kbps) and 2x CD-ROM data rates. It’s used for a wide range of applications, from CD-ROMs to kiosks. To achieve this level of quality, MPEG requires fairly powerful playback hardware. Nearly all computers sold today have sufficient CPU power for basic playback, and many high-quality video cards now include MPEG playback acceleration. 


MPEG-1 is supported by QuickTime 3 and DirectShow 6

MPEG-2 



MPEG-2 is designed for broadcast-quality digitally encoded audio and video. It offers outstanding image quality and resolution. MPEG-2 is the primary video standard for DVD Video. Playback of MPEG-2 video generally requires special hardware, which is built into all DVD Video players, and most DVD-ROM kits. Very fast CPUs may be able to play MPEG-2 without specialized hardware, but this is rare as of now. MPEG-2 is based on MPEG-1, but optimized for higher data rates. This allows for excellent quality at DVD rates (300-1,000 kbps), but tends to produce results inferior to MPEG-1 at lower rates. MPEG-2 is definitely not suitable for use over Internet connections, but is well suited if you plan to broadcast your work over TV. 

One limitation of MPEG is that it takes quite an effort to encode and playback MPEG video. That’s why it was originally considered a hardware-assisted compression and playback codec. MPEG files can also be compressed using software only, but expect to spend hours processing only a few seconds of video.



Supported by DirectShow, DVD Video players, and some cable/satellite distribution systems. 

Cinepak



Cinepak has always been great for CD-ROM content. It’s an asymmetrical compression method–it takes a lot longer to compress Cinepak video than to decompress it; but once compressed, 320x240 Cinepak files look great, playing back at 15 fps. 

The time taken for compression makes Cinepak an inappropriate method for capturing video into your computer. But the fast decompression makes it a great way to deliver video on CD-ROM. Another advantage is that a Cinepak movie can play back on both Mac and PC. 

Indeo 3.2



Indeo 3.2 was developed by Intel in the 1980s, and was originally known as RealTime Video 2.1 (RT2.1). Indeo is very similar to the Cinepak, but it takes less time than Cinepak to compress files.


Indeo Video Interactive (IVI)

More recent versions of Indeo—IVI—uses a completely different technology for compression. Like MPEG, IVI uses inter-frame encoding but unlike most other codecs, IVI is based on wavelets. 



This divides each frame into a series of bands, with each describing the image at different levels of detail. The first band contains rough colors and details, the next one contains additional detail, the third one still more, with the last section containing the highest level of resolution. Although all layers are needed to perfectly recreate the original image, the first two or three layers are enough for users to at least see the video.

These bands come in handy when dealing with different processor speeds and system capabilities. For example, with a PIII you’ll be able to see the video at full resolution, while with an old 486, you’ll see only some of the detail in the same IVI file. Such scalability is useful when you want to send your video over the Web, where bandwidth remains a serious limitation. 

To reduce compression times, IVI combines hardware-assisted compression with software decompression. You can use an Indeo board to speed up the compression process but for viewing the clip, you don’t need any specialized hardware. You just need to install the Indeo software codec—available free of cost—on your Mac or PC.

This codec is very useful if you want to send your video over the Web. It’s supported by QuickTime (Indeo 4 is built into QuickTime 4, while Indeo 5 support is available separately), Video for Windows, and DirectShow. IVI is currently into version 5.1.

H.261 



A standard video-conferencing codec. As such, it’s designed for low data rates and relatively low motion. H.261 was used as a starting point for the development of MPEG (which is optimized for higher data rates).

H.263 



Another standard video-conferencing codec. It’s an advancement of the H.261 and MPEG-1 standards, designed with the goal of producing substantially better quality at data rates below 64 kbps. 


Supported by NetShow, QuickTime, and Video for Windows.

The biggest challenge for compression algorithms is delivering video over the Web. Consider this. Most Web-cruising Netizens have a 14.4 kbps or 28.8 kbps modem connection. 28.8 kbps is pretty fast, right? Not when you compare it with the slowest CD-ROM drive in the world. An old 1x drive pumps out 150 kbps. That’s more than 40 times faster than the throughput of a 28.8 kbps modem. 

By now, you’d have a basic understanding of the way video is compressed and the technologies used to play it back. As stated before, which codec you choose depends on where you want your video to be played. For example, Cinepak is considered a good codec for running video off CD-ROMS, while IVI is more suited to the Web, where bandwidth and system capabilities differ from user to user.

Advertisment