Accessibility

Manic compression

At some point in the life of a digital video clip, it gets compressed (often several times). The whole idea behind compression is to lower the amount of data in the video to reduce its file size, lower the date rate, or both. Smaller files take up less storage space, and are easier to move around, while video with a lower data rate can be streamed over the Internet, or played back on a slow computer. If it were not for compression, there would be no way to fit a feature film onto something as small as a DVD, or to record high-quality video on a tape as small as the Mini-DV format.

Requirements

To complete this article, you will need the following software:

Adobe After Effects 7.0

Adobe Encore DVD 2.0

Adobe Premiere Pro 2.0

Adobe Flash Professional 8

Prerequisite knowledge:

Basic knowledge of digital video

Types of compression

There are two kinds of video compression—lossless and lossy. Lossless compression lowers the amount of data in the video without any visible quality loss (although I know quite a few television engineers who will debate this point vigorously). Lossy compression degrades the video to some extent, sometimes noticeably, sometimes not. It all depends on the codec used, and the settings of that particular codec.

Codec stands for compressor/decompressor. There are hardware-based codecs (like the codec used in a Digibeta camera) and software-based codecs (like the On2 VP6 codec used in Flash 8 Video Encoder). The video on DVDs is compressed with the MPEG-2 codec, which is also used for satellite and digital cable transmission (you know how the picture falls apart a bit on some of those esoteric channels on your digital cable? That's MPEG-2).

Both QuickTime and Windows Media include many codecs, and knowing which one to use when is a fundamental in digital video postproduction.

Let's take a look at the most common workflow for digital video. A MiniDV camcorder records a compressed video signal to tape with its internal lossy DV codec. DV compression is 5:1, meaning for every five bits of data, only one is written to tape; the other four are discarded. The resulting loss in quality is not generally noticeable to the untrained eye, but for those of us who do this for a living, the loss of color range, digital artifacts, and noise in the compressed video is easy to recognize.

When you capture your tape to hard disk using Adobe® Premiere® Pro or other software, the video becomes an AVI (Windows Media) or QuickTime file written with its DV codec.

AVI Video Compression dialog box

Figure 1: The AVI Video Compression dialog box in Adobe After Effects®, showing the Microsoft DV Codec selected in a pop-up menu showing all the AVI codecs on my system.

Essentially, the compressed DV data is copied from videotape to hard drive via a Firewire cable, with no further compression taking place. If all you were to do is edit the video without rendering anything and lay it back to tape, it wouldn’t be compressed further.

But, if you render a DV codec clip with the DV codec, it will be compressed again (5:1 lossy compression). That means you take something where four bits of every five have already been discarded, and then discard four bits out of five of that remaining one bit. In other words, you wind up with something that looks like it went through a meat grinder. It's not pretty.

So how to conquer this? Render uncompressed, or even better, to a lossless codec. Select No Compression (see Figure 1) and your rendered video will suffer no quality loss. You will, however, wind up with a huge file, so you'll need to have plenty of hard disk space if you're doing lots of renders. A better solution is to render using the Animation Codec, which is part of QuickTime.

QuickTime’s Animation codec

When you set the Quality slider in QuickTime to Best, the Animation codec's compression is lossless. The files are much smaller than uncompressed files, but there is no noticeable loss in quality. This is one of the main codecs used in an After Effects workflow, and is great intermediate codec to use when working with DV material. As long as you render this way, you'll never lose quality—although if you're going back to MiniDV tape, you’ll have to render your final results to a DV codec eventually (a good reason to avoid doing this).

QuickTime's Animation codec

Figure 2: QuickTime's Animation codec, set to Best quality, which results in lossless compression.

There are two QuickTime codecs you should absolutely never use, under any circumstances. Those codecs are Cinepak and Video (ironically). The Video codec is a legacy codec in QuickTime, dating back to the early 90s, and is simply not suitable for video (although it must have been at some point). Cinepak is another oldie-but-baddie and was the first codec used for stuffing video onto CD-ROMs. Like the Video codec, it's now obsolete, but is still included in QuickTime for legacy file support.

Flash Video

If you’re putting your video on the Internet, use Flash Video that compresses and decompresses using the On2 VP6 codec (a codec we license from a company called On2). You can encode to Flash Video with Adobe Premiere Pro 2.0 by choosing File > Export > Adobe Media Encoder. In After Effects 7.0, choose  File > Export > Flash Video. You can also use the standalone Flash 8 Video Encoder that comes with Macromedia Studio 8, or use Flash Professional 8.

Adobe Media Encoder

You can use Adobe Media Encoder in Adobe Encore DVD® and Adobe Premiere Pro to export video. To get your video onto a DVD, encode it to MPEG-2 using Adobe Media Encoder, or open it in Encore DVD, which can also encode MPEG-2. In either case, it will be compressed with the super high-quality Main Concept MPEG-2 Encoder.

Compression for iPod

The iPod uses a proprietary MPEG-4 codec (MPEG stands for Motion Picture Experts Group), and you can encode your video for iPod by dragging and dropping it into iTunes. Mobile phones use codecs such as H.263.

Conclusion

I could go on and on, but the main thing is to get to know the codecs you work with on a daily basis—what their settings are and how to manipulate them to get the best results (although some codecs, such as DV, don’t have adjustable settings). With lossy codecs, it’s always a trade-off between quality and file size and data rate. You don’t have to become a Compressionist to get good at this, but if you want to dig deeper, there’s some great reading out there. My favorite author and authority on the topic is Ben Waggoner, who explains this somewhat complex topic in an easy-to-understand way in his book, “Compression for Great Digital Video: Power Tips, Techniques, and Common Sense.”

Where to go from here

To learn more about video compression, check out the following resources: