Codec Information
A codec, or compressor/decompressor, is tool used to compress video and audio so that they take up less space. Most codecs are lossy, which means that some of the original data is discarded to reduce the file size. A codec tries to remove only portions of the data that humans are not likely to notice. However, if you set the compression level of a codec too high, it will remove portions of the data that are easily noticeable. Therefore, when using codecs to compress your video, there is a tradeoff between quality and file size.
There are a number of common codecs used on the internet. Some are better at retaining video quality than others. Also, one codec may be better suited to a particular type of video than another. It is important to keep this in mind when choosing a codec.
Below I have compiled a list of the most widespread video codecs found on the internet today. I have included a brief explanation of each codec that points out its features and flaws.
MPEG-1
Used in: .mpg files, VCDs
Description:
MPEG-1 is one of the older formats used on the internet. Because of this, virtually every computer has support for MPEG-1 files. MPEG-1 can support videos of any practical resolution and frame rate, but it is generally used for lower resolution video (e.g. 320 x 240 at 30 fps).
Pros:
MPEG-1 videos will play on almost any computer.
MPEG-1 has a fixed frame rate, so a properly encoded video can be completely smooth at all times.
Cons:
MPEG-1 doesn't have inherent support for interlaced video, so MPEG-2 is better for high resolution video in this respect.
MPEG-1 usually uses MPEG Layer 2 Audio, which isn't as efficient as other audio codecs at lower bitrates.
Compared to the other codecs found on the web, MPEG-1 uses a very high bitrate. (For this reason, I do not recommend using MPEG-1 for distribution of video on the web. Other video formats (RealVideo, MPEG-4, etc.) will provide higher quality in a smaller file size. I'd only suggest using MPEG-1 if file size isn't that important or you are sure that your target audience will have a hard time playing other formats.)
MPEG-2
Used in: .mpg files, DVDs, SVCDs
Description:
MPEG-2 was designed to support high resolution, high bitrate videos. It is most often used to store high quality video at a high resolution, like that found on a DVD. It is generally not used with files distributed on the internet.
Pros:
MPEG-2 has direct support for interlaced video, making it optimal for high resolution video.
Due to its high bitrate, MPEG-2 produces videos of very high quality.
Since MPEG-2 has a fixed frame rate, a properly encoded video can be completely smooth at all times.
Cons:
MPEG-2 requires a fast CPU to decode the video in real-time.
MPEG-2 files require a very high bitrate to maintain acceptable quality, making this format unsuitable for internet distribution of video.
MPEG-4
Used in: .asf and .wmv files (Windows Media), certain .avi files (often using hacked codecs such as DivX 3, Angelpotion, etc.)
Description:
MPEG-4 was designed for higher quality files at lower bitrates. This makes it an excellent choice for distributing many types of video on the internet.
Pros:
MPEG-4 can handle videos of any resolution at relatively low bitrates.
MPEG-4 produces a high quality output for many types of input video.
Cons:
MPEG-4 files usually use MPEG Layer 3 Audio or Windows Media Audio, which doesn't sound as good as RealAudio at lower bitrates (less than 64 Kbit/sec).
High resolution MPEG-4 videos require a fast computer for real-time decompression and viewing.
MPEG-4 has a variable frame rate, which produces choppy video if the bitrate is not high enough.
MPEG-4 is not as efficient for cartoons at 320 x 240 as RealVideo.
The most common codec for MPEG-4, DivX 3, is illegal (for
several reasons). First of all, the DivX 3 codec is a hacked copy of
Microsoft's MPEG-4 codec. The authors of DivX 3 had no right to modify
Microsoft's code, and they certainly don't have the right to distribute the
files. And second, the DivX 3 codec includes a hacked, warezed copy of
the Fraunhofer MP3 codec. This is commercial software that costs $200
(US), and even that price doesn't unlock all of the features that the hacked
version provides.
I suggest using DivX 4 instead of DivX 3 because DivX 4 is not based on
illegal software.
RealVideo 8
Used in: .rm files (RealMedia)
Description:
RealVideo 8 is the latest codec from RealNetworks. It is a major upgrade the older RealVideo G2 codec. RealVideo 8 is my recommended format for distribution of 320 x 240 cartoons on the internet.
Pros:
For cartoons, RealVideo 8 is excellent at producing video at lower bitrates with few compression artifacts.
RealVideo 8 very accurately retains the original color information. It is especially good at keeping regions of solid colors and sharp edges separate, which are commonly found in cartoons.
Practically everyone has RealPlayer, and it's downloadable for free.
RealAudio, the audio codec for RealMedia files, produces very good sound at lower bitrates (like 32 Kbit/sec).
Cons:
RealVideo does not work as well with higher resolution video (above 320 x 240).
You cannot convert a RealMedia video directly to another video format. Although you can do this with screen capturing software, the process doesn't work perfectly.
RealVideo 8 has a variable frame rate, which create choppy video if the bitrate is not high enough.
The Plus version of RealProducer, which offers enhanced control over the codecs and bitrates, is not free.
Sorenson Video 2.1
Used in: certain .mov files
Description:
Sorenson Video 2.1 is preferred codec for the QuickTime format. It comes in both Standard and Developer editions, which differ in terms of the encoding features they offer.
Pros:
It produces a higher quality video at lower bitrates than some other formats (e.g. MPEG-1).
You can choose whether or not you'd like the encoder to drop frames when the action gets too intense in a video.
Cons:
Since this codec is proprietary to QuickTime, it can only be played on Windows or MacOS-based computers.
At equivalent bitrates, Sorenson usually produces a lower quality file than MPEG-4.
When encoding cartoons at equivalent bitrates, RealVideo 8 produces a higher quality video than Sorenson.
Sorenson requires a fast processor, especially at higher resolutions.
The Developer Edition of Sorenson Video, which provides numerous features (such as VBR support), is not free. You also need a separate product, Terran Media Cleaner Pro, to take full advantage of the Developer Edition of the Sorenson codec.
When encoding a video, Sorenson converts the input format to the YUV9 color space. This noticeably decreases the quality of the video and prevents Sorenson from accurately retaining the original color information.