Codecs & Formats - Video

What It

Codec is an acronym for Compress-Decompress. Codecs are used to compress and decompress audio and video data to save diskspace and bandwidth. The compressed audio and video streams are stored in a container with additional metadata.

Some examples of video codecs:



DV (Digital Video) is both a video codec and a video/audio container format used primarily in camcorders.

* As a container format, it contains video in DV (the codec) format, and audio in uncompressed PCM format. The audio can be either 2 channels at 16 bits and 48kHz, or 4 channels at 12 bits and 32 kHz. Each frame is exactly 120,000 bytes (NTSC) or 144,000 bytes (PAL), and the frame rate is fixed at the standard NTSC/PAL frame rate (29.97 or 25 frames per second, respectively).

* As a codec, it encodes video at 720x480 (NTSC) or 720x576 (PAL) pixels per frame. Frames are encoded independently, much like MJPEG?. Note that the field size is slightly wider than that of a standard television; the frame width must be cropped to 704 pixels to achieve the correct aspect ratio when displayed on a TV.


MPEG-1 was an early standard for lossy compression of video and audio. It was designed to compress VHS-quality raw digital video and CD audio down to 1.5 Mbit/s (26:1 and 6:1 compression ratios respectively) without obvious quality loss, making Video CDs, digital cable/satellite TV and digital audio broadcasting (DAB) possible.

Today, MPEG-1 has become the most widely compatible lossy audio/video format in the world, and is used in a large number of products and technologies. Perhaps the best-known part of the MPEG-1 standard is the MP3 audio format it introduced.

Despite its age, MPEG-1 is not necessarily obsolete or substantially inferior to newer technologies. According to Leonardo Chiariglione (co-founder of MPEG): "the idea that compression technology keeps on improving is a myth."


MPEG-2 is a standard for "the generic coding of moving pictures and associated audio information".[1] It describes a combination of lossy video compression and lossy audio compression (audio data compression) methods which permit storage and transmission of movies using currently available storage media and transmission bandwidth.


MPEG-4 Part 2 ("MPEG-4 ASP") is a video compression technology developed by MPEG. It is a discrete cosine transform compression standard, similar to MPEG-1 and MPEG-2. Several popular codecs including DivX, Xvid and Nero Digital are implementations MPEG-4.

MPEG-4 Part 10 defines a different format than MPEG-4 Part 2 and should not be confused with it. MPEG-4 Part 10 is commonly referred to as H.264 or AVC, and was jointly developed by ITU-T and MPEG.


An MPEG Program Stream, as found in a dvd vob file.


DivX is a commercial video codec created by DivX Inc. (formerly DivXNetworks Inc.). The DivX codec has become popular as it can compress large video segments into much smaller sizes while maintaining high video quality. The DivX codec uses lossy MPEG-4 Part 2 compression, also known as MPEG-4 ASP, where quality is balanced against file size.


Xvid is a video codec for PC's (codec is an abbreviation for [co]der/[dec]oder and describes a program to encode and decode digital video). The purpose of encoding video data is to reduce redundancies – that means to make it smaller for faster transmission over computer networks or for more efficient storage on computer disks.

Xvid can be seen as a ZIP for video. Unlike ZIP, Xvid is not lossless. That means a video after compression and decompression with Xvid won't be identical to the original source. Typically however, a difference to the source is visually imperceptible.

So Xvid removes information that is not important for human perception, which is somewhat similar to MP3 for audio. This enables very high compression rates that allow to effectively work with digital video on home computers at all. To give an example: uncompressed digital video is huge and requires about 100 GB per hour at PAL resolution. The same video would require just 500 MB per hour at very high quality when compressed with Xvid. That is a compression ratio of 200:1.

Xvid is Free Software and released under the GNU GPL license. This means that the source code of the software is publically available and programmers are allowed to make modifications to the code. Also, redistribution of Xvid is permitted but only under the terms of the GPL license.

So the GPL grants recipients more freedoms than it’s common with other software. Therefore, and due to its very high image quality that has been approved in independent tests conducted by third parties the Xvid codec has gained great popularity in the recent past and has become the codec of choice when it comes to exchanging digital video.

Container Formats


AVI (Audio Video Interleaved) containers usually hold an mpeg4 video stream and one or more audio streams, either mp3 or AC3.

There are two flavors of AVI, interleaved and non-interleaved. Interleaved consists of packets of video and audio "interleaved" to make synchronous playback and seeking possible. Non-interleaved consists of the entire video stream followed by the entire audio stream, a fragile construction indeed.

It is possible to concatenate avi container content and produce really horrible things, even to the extent of mixing interleaved and non-interleaved avi material.

The avi container format was invented by Micro$oft.


The .mkv or Matroska container format supports the inclusion of video, audio, subtitles, fonts, still images, timecodes, and who knows what else.

Audio Codecs


AC3 (or AC-3) is Dolby Digital's third generation audio codec, which supports up to 5.1 channel surround sound. This means 5 channels of full sound, with an extra channel for sound enhancements; the subwoofer. It is also known as an ATSC standard, named A52 revision B.


MP3, is a digital audio encoding format using a form of lossy data compression. Its correct name is MPEG-1 Audio Layer 3. MP3 is the most common audio format for consumer audio storage, and a de facto standard for the transfer and playback of music on digital audio players.