You are here

What is a CODEC?

What is a CODEC?

Codec. It is a term that sometimes strikes fear into even the most experienced of video editors.

Why? Because there are so darn many of them, and it is more often than not quite difficult to tell the difference between them. To understand those differences (or at least some of them) and which one fits your needs, it might be best to start at the beginning... with a simple definition.

Codec is really the meshing of two words: coder and decoder (co/dec). What do they do? In the simplest explanation, codecs encode and compress streams of data for storage or they decompress for playback or even editing.

A codec is usually a small piece of computer code that performs its magic whenever it's called by a piece of software, but a codec can also be a physical piece of hardware responsible for turning analog video and audio into a digital format. This happens in real time, either at the point of capture or the point of playback. The codec can also perform the reverse function, turning digital video and audio signals into an analog format. If you're not working as a broadcast engineer, however, you will most likely be using a computer codec to compress your video and audio data into a more manageable size for viewing, transfer or storage.

Types of Codecs

Now that you know what codecs do and why they're used, let's look at the variety of codecs that are out there and which ones might best fit your needs.

There are a couple of umbrellas under which to group a variety of codecs. Lossless codecs are just like they sound. They reproduce video exactly as it is without any loss in quality. Lossy codecs, however, lose varying amounts of information but reproduce the compressed material using less data space. Lossy codecs are great for compressing data that needs to be sent via e-mail or uploaded to the internet for streaming.

Transformative codecs cut up the material into manageable chunks before actually compressing it, and predictive codecs compare the data you're compressing with adjacent data and then get rid of unnecessary data in order to maximize space. Overall, these codecs all work toward the same end: putting your data into a manageable file type with as little loss of information as possible.

Many different codecs fall under these four basic codec types. The most widely recognized family of codecs is based on MPEG standards. MPEG is an acronym for Moving Picture Experts Group. This is the organization that sets and codifies the standards. There are three primary MPEG formats and a multitude of derivative types.

MPEG-1 is a data stream which reproduces with incredibly high quality. The MP3 (MPEG-1 Layer 3) standard for audio compression, developed by Fraunhofer, is an application for the MPEG-1 data stream - MPEG-1 video does not always include MP3 audio.

Almost all computers and consumer DVD players support both MPEG-1 and the MP3 digital audio encoding formats. One drawback is that MPEG-1 allows only for progressive scanning. Progressive scanning is a method of storing and displaying moving images where all of the lines of the image are drawn in sequence. This is in contrast to interlaced scanning, where all the odd lines of an image are drawn first, then all of the even lines are drawn. MP3, on the other hand, while lossy and quite small, is the standard for nearly all digital music storage devices, audio players and retail sites. The typical MP3 audio file is created at 128kbits per second, which is around 1/11th of the size of the original audio data that would be on a CD.

MPEG-2 is a very high standard and the only video compression standard used for DVD-video compliant discs. Even though new codecs have been introduced which compress at a higher quality, MPEG-2 is still the standard for DVD production, and it is also an option for Blu-ray Disc creation.

MPEG-4 handles both progressive and interlaced video. It employs better compression techniques than MPEG-2 and, like MPEG-2, it is a widely-accepted compression standard. In fact, there are a number of codecs that are derived from MPEG-4. One of them is the H.264 codec, which is another option for encoding video for Blu-ray Disc, as well as for videos found on the iTunes store. H.264 is a family of standards with great flexibility and a wide variety of applications. H.264 enables compression for high and low bit rates and both high and low video resolutions. Adjusting size allows users to use this same standard for compressing for broadcast, multimedia usage and large file storage.

WMV

Another well known codec or family of codecs is WMV, which stands for Windows Media Video. With the glut of Windows users out there, it's no wonder this codec family is so popular.

Originally designed to compress files for internet streaming, WMV was introduced as a competitor to the RealVideo compression codec. Microsoft's WMV 9 has been around for quite some time at this point, and Microsoft claims that it provides a compression ratio that is two times better than MPEG-4 and three times better than MPEG-2. WMV 9 is also the basis of the SMPTE VC-1 video compression standard, which is another format that can be used for encoding video for Blu-ray Disc.

A widely-used codec is the DV codec, which utilizes both raw video and audio data. The popular Mini DV format uses DV25, which runs at 25 megabits per second. When the video is captured to a computer running Windows, it will typically be written to an AVI file; on a Mac, it will typically be written to a QuickTime file. AVI and QuickTime are "containers". The data inside the container is pretty much the same.

So what is a container? The name says a lot. A container is kind of like the wrapping on a present. It refers to the way in which information is stored, but not necessarily how it is coded. For example, QuickTime is a container that wraps around a variety of compression codecs, like MPEG-4, k3g, skm and others.

What Do YOU Need?

So, which codec is the best codec for you? It's tough to say. The information is laid out in this article simply to shed a bit of light on why some codecs are used when. The point is, you're not supposed to understand it all, nor should you be able to rattle off a list of the best codecs for any given application at the drop of a hat. Just know that the next time you're asking yourself which codec to use, you're best served to figure out what you want your end result to be. Are you compressing for storage or for high quality viewing? Are you okay with a little data loss or do you want your finished files to be clean and pristine? If you first know what you want, then work backwards and do a little research on what the pros are doing to get the same results, you're guaranteed to find the codec that is just right for the job.

So now that you have at least a slightly better understanding of some of the more popular codecs, it might also be helpful to know which formats utilize those codecs. Read our associated story Transmission Formats for more.

Michael Fitzer is an Emmy award-winning commercial and documentary writer/ producer.

Tags:  February 2010
Michael
Fitzer
Mon, 02/01/2010 - 12:00am