CNET's Donald Bell walks you through the basics of how digital video files work, including information on codecs, video containers, and bit rate.
If you want to transfer a CD onto your iPod, computer, or cell phone, you can always rip the disc to MP3 and reasonably expect it to play on all of your devices. But things aren't quite as simple if you want to do the same thing with a DVD.
Digital video files are complicated, and they come in thousands of varieties. The devices that play digital video are equally complex. A video that plays fine on your computer, may not play on your iPod or mobile phone.
There's no simple solution for making video formats easy to deal with. But with any luck, by the end of this tutorial you'll have a better understanding of how digital video formats work and why they can be so fickle.
To get a better sense of the anatomy of a digital video file, let's dissect an example. Here we have an MP4 video file created by ripping a DVD to our computer using the program Handbrake. Don't be alarmed by the funky file name, the movie is a Japanese anime film called Tekkon Kinkreet.
Aside from the .MP4 extension at the end of this file, we don't know a whole lot about it just from looking at it. I couldn't tell you if it will work on your iPod or whether it's in HD, or if it will play on your particular brand of mobile phone.
All the .MP4 extension tells us is what kind of container format the video uses. Video containers are like folders, or ZIP files, that hold all of the elements that make up a digital video file. If you could peek inside, you'd find the video and the audio track as separate files, along with extras such as subtitles, and alternate audio tracks.
In this example we have a video with a .MP4 container, but there are dozens of other container formats out there. Extensions such as MP4, MOV, AVI, FLV, VOB, and ASF are all fairly common.
But to really get an understanding of what kind of video file you're dealing with, and what programs and devices it'll play friendly with, you'll need to figure out how the video was encoded.
Video encoding works on the same basic principal as audio encoding. To turn a raw CD into an MP3 file, a program like iTunes uses an MP3 codec to analyze the incoming audio and find a prescribed way to streamline all that data into a more efficient, space-saving file. In the audio world, you have different codecs such as AAC, MP3, Ogg, FLAC, Apple Lossless, Windows Media, etc. Most of these codecs do more or less the same thing, while some of them are specialized for a specific purpose (lossless codecs, for example, are incapable of degrading the audio fed into them).
Likewise, video codecs such as MPEG2, H.264 (AVC), DivX, WMV, Xvid, QuickTime, and others, are designed to look at an incoming digital video feed and find an efficient way to compress all the data into a compact file. Some codecs, like MPEG2, are the standard used for DVDs; H.264 is a standard used by iPods and video podcasts, WMV is a favorite of Windows and XBox videos, and DivX and XviD files abound on P2P services.
To figure out what codecs are used on your video file, PC users can use a free program like VLC (open the file and use the Control+I command to view extended media information). On a Mac, simply highlight any video file and select Get Info from the Desktop file menu (Command+I). In either case, you should be able to view both the video codec type and the audio codec type used for the selected file.
Now that you know the video file's container type and how it was encoded, you're halfway to truly comprehending what kind of video you're dealing with, and which software and devices it will work with.
To play this video--whether it's on your computer, your phone, or your iPod--the video player needs to be able to unlock the container and decode all the contents. With so many elements involved, it's easy for something to go wrong. Maybe iTunes is fine with the MP4 container and the AAC audio, but if the video is formatted in something iTunes doesn't like, such as DivX: you're hosed.
To make things even more complicated, you've got things like bit rate, frame rate, and resolution--all of which can potentially break compatibility with your device
Like MP3 files, bit rate is used to describe how many bits of data are used to describe a single second of playback. The more bits you have, the better the codec can describe what's going on, and the better the picture quality.
Frame rate describes how fast each frame of video will whiz past your eyes. DVD-quality video ranges from 25 to 30 frames per second. Anything below 20 will tend to look a little choppy, and anything over 30 is probably a waste of time, unless the source material was designed for it.
Finally, there's resolution. The finer points of digital video resolution are probably worth a whole other tutorial. Basically, you're looking at two numbers, one that tells you how many pixels wide your video is, and one that tells you how tall. An HD video can be up to 1,080 pixels tall or larger, but if you're just watching it on an iPod, the screen on something like the Touch is only 480x320 and the video decoder chip can't handle much beyond 640x480.
Long story short, bit rate, frame rate, resolution: bigger numbers are usually better, but check to make sure the device you're playing the video on can support those numbers or actually take advantage of the improved quality.