Why video codecs matter

Larry Jordan#

Author: Larry Jordan#

Published 1st April 2015

by Larry Jordan Issue 99 - March 2015

Video codecs confuse a lot of people. But understanding codecs is critical to just about every element of video production, editing and distribution.
Codec is an acronym that stands for "COmpressor/DECompressor.\" It is easy to get intimidated by all the technical jargon surrounding codecs, but, at their core, a codec is the math that converts the light we see and the sound we hear into ones and zeros that can be stored and displayed on a computer. The "compressor\" part converts light and sound into ones and zeros, while the "decompressor\" part converts the ones and zeros into light and sound.
Codecs are the key element in determining file size and image/sound quality. Common codecs include:
* JPEG, PNG and TIFF for still images
* MP3, AAC, and AIF for audio
* H.264, MPEG-2 and ProRes for video

However, that is only a small sample of the codecs available. The last time I checked, there were more than 400 codecs in active use! Why so many? Because there is no one codec that works well for all situations.
For example, there are codecs that are optimized to create small file sizes - JPG or H.264 - while other codecs are optimized for editing - PNG or ProRes. Some codecs are designed to retain maximum exposure and color data - TIFF or 12-bit RAW files - while others reduce color information to maximize download speeds - GIF or H.265.
The question isn\'t "what\'s the best codec?\" Instead the question is "what\'s the best codec for what I want to do?"
A THREE-CODEC ENVIRONMENT
In the past, when we were shooting and editing standard-definition video, we shot DigiBeta (or DV), edited DigiBeta (or DV) and output DigiBeta (or DV). The format we shot was the format we edited was the format we output.
Those days are long gone. Sigh...
Now, codecs are optimized for specific functions: shooting, editing and distribution. We need to convert between codecs as our project moves through to completion. Understanding the differences between these three types of codecs will help you better understand your options.
Here\'s the basic problem: an uncompressed 12-bit 1080p/25 video clip requires about 155 MB/second for playback! That\'s faster than any single spinning media hard disk. This format takes more than 560 GB to store an hour of this media! Unless we are recording directly to a hard disk, we must compress the file in order to store it anywhere.
Many cameras record a version of AVCHD or H.264. This is a very compressed format specifically designed to be recorded on SDHX or SDXC cards that slip into your camera. (SDHX stands for SecureDigital - High Capacity, while SDXC stands for SecureDigital - eXtended Capacity.)
The good news about these cards is that they are small, light and ubiquitous; lots of companies make them. The bad news is that they have a very limited bandwidth, between 6 and 10 MB/second. (There is a UHS Class 3 card which supports speeds up to 30 MB/second, which is designed for 2K and 4K media recording.)
Still, 30 MB/second is a far cry from the 155 MB/s source file. Hence, the AVCHD codec was invented to compress the file in the camera so it can be safely stored in real-time to the SDHC card.

THE BATHTUB VS. THE BUCKET
However, just because we use AVCHD for recording media does not make it a good choice for editing. AVCHD compresses video in clumps, called a "Group of Pictures\" (GOP). GOP compression looks at a seven frame block and just notes the pixels that changed. This block format is very efficient, but hard to decompress with all the back-and-forth that video editing entails.
For editing, we need something much more efficient where each image is compressed individually, not as part of a group. This type of individual frame compression is called "I-frame\" compression and provides for much more responsive editing, rendering and exporting than GOP compression.
Also, the 8-bit color depth of AVCHD and H.264 is constrained. While 8-bit is acceptable for black-and-white images, it is not sufficient for accurate color. Color ideally requires a 10-bit-depth or more for smooth gradients and color grading.
This is where formats such as ProRes, DNxHD, AVC-Intra or Cineform shine. All are 10-bit and use I-frame compression. They provide outstanding image and sound quality, but at the expense of creating larger files; generally 2-4 times larger than the camera native media.
The process of converting from camera native to a mezzanine format (we call it "mezzanine\" because this codec is in the middle between shooting and distribution) is called "transcoding."
Here\'s a good analogy. Imagine that shooting video is like pouring water into a five-gallon bucket. When the bucket is full, we dump it into a bathtub. The bucket is the AVCHD codec. The bathtub is ProRes (or any other mezzanine codec). Because the bathtub is so much larger than than the bucket, we don\'t lose any quality when we convert the media.
After editing is complete, the finished file is way too large to post to the web or burn to a DVD; though it is fine for distribution via broadcast or cable. If the web is our goal, we need to compress the file from the master file created by our editing software into something small enough for people to download.
Again, we are back to a bandwidth issue. Most web videos are compressed for playback at less than 1 MB/second. This is even more compressed than the original camera master, and a far cry from the uncompressed data rate. This is where H.264 comes in. It creates very small files, with pretty high image and audio quality.
Back to our bathtub analogy, we are now pouring that bathtub filled with water into a 1 cup measuring cup. Almost all the water in the tub will be lost - permanently destroyed in the compression process.(This is why you don\'t want to recompress already compressed material - there\'s nothing there to compress a second time.)
SUMMARY
Codecs exist to convert reality into ones and zeros for the computer. Different codecs exist to meet the requirements of different jobs: production, editing or distribution. Understanding the strengths and weaknesses of different codecs will allow you to optimize quality and performance throughout the entire production process.

Related Articles

Related News

Related Videos

© KitPlus (tv-bay limited). All trademarks recognised. Reproduction of this content is strictly prohibited without written consent.