Pinterest Stumbleupon Whatsapp
Advertisement

Explaining the difference between codecs and containers is relatively simple, but hard part is attempting to understand each format. The lines start to get blurred when you realize that most common codecs aren’t exclusive, and can make use of multiple compression technologies in order to get the job done. The blurred line becomes nearly invisible when you start to talk about formats like MPEG-4 which could be classified as a bit of a container and a bit of a codec, but that’s a rather complicated classification that’s best left for another time.

So, how do you teach yourself the difference between dozens of codec and container options? Don’t. There is only a handful of technologies that are used for online video, and the bulk of your effort will be spent understanding how these work, as well as understanding the trade-offs you’re faced with when deciding on what to use.

You could spend weeks studying technologies that are only used for a relatively small number of applications, so instead we’re going to focus our attention on what technologies you’ll use for most of your video encoding and playback needs.

video-tunnel

What Is a Codec?

A codec – or coder/decoder – is an encoding tool that processes video and stores it in a stream of bytes. Codecs use algorithms to effectively shrink the size of the audio or video file, and then decompress it when needed. There are dozens of different types of codecs, and each uses a different technology in order to encode and shrink your video file for the intended application.

Depending on the codec, this encoding occurs in one of two ways: lossy or a lossless compression How Does File Compression Work? How Does File Compression Work? File compression is at the core of how the modern web works, one could argue, because it allows us to share files that would otherwise take too long to transfer. But how does it work? Read More .

Advertisement

Lossy Compression

When looking for manageable file sizes, lossy compression is the most viable method available. While you certainly lose quality in audio, video, or both, the compression is a necessary evil (currently) in a world dominated by the need to share and store what would otherwise amount to impractical file sizes. Your average Blu-ray, for example, can exceed 40 gigabytes, and that sort of storage space would not only be expensive, but it’d make digital downloads and purchases inconvenient, if not an outright waste of time. The key when using lossy compression is to settle on the highest quality compression format for your intended use, so that you walk the fine line between loss of quality, and file size.

lossless-vs-lossy-compression-dragonfly

Lossless Compression

Lossless compression works much like a ZIP or RAR file in that after compressing and decompressing, the file is essentially the same. Through use of smart algorithms, the file doesn’t lose much quality, but it’s not an efficient way to store large files because there isn’t much compression that actually takes place. In addition, online transmission of large video files uses far too much bandwidth (although H.265 encoding may change that New H.265 Video Format Could Bring 4K To Broadband Connections [Updates] New H.265 Video Format Could Bring 4K To Broadband Connections [Updates] The International Telecommunication Union (ITU) announced its approval of the H.265 video format standard on Friday. The new codec may bring 4K video to broadband and also limit bandwidth usage for HD streaming, offering both... Read More ) to make it a viable compression option.

Unless you work in the film industry, or in video editing, it’s unlikely you’ll ever share video files in a lossless format (if even then). To put it into perspective, even a 4k television doesn’t contain the resolution needed to display a film shot on a modern camera and delivered without some sort of compression. In fact, it’s not even close (yet). While 4k video is beautiful 8 Eye-Popping Ultra HD Videos To Watch On Your New 4K TV [Stuff to Watch] 8 Eye-Popping Ultra HD Videos To Watch On Your New 4K TV [Stuff to Watch] We've trawled high and low and found some eye-popping 4K videos that take full advantage of the ridiculous number of pixels at your disposal, for free. Read More , it’s not even close to the size of an uncompressed video format.

While a Blu-ray film is less than 50 gigabytes (if it has to fit on one disc), the first downloadable 4k movie (available to consumers – trailer below) is a whopping 160 gigabytes! Completely uncompressed 1080p video is a mind-boggling 410 gigabytes per hour, and that doesn’t include the audio file, which could add an additional 7 gigabytes per hour depending on how it was recorded. All-in-all, these files are all but useless for a consumer market with current technology.

It’s also important to note that codecs aren’t just for compression of audio Audio File Formats Explained in Simple Terms Audio File Formats Explained in Simple Terms Read More and video files. Once a file has been encoded using a specific codec, that same codec must be used to decode the file in order for it to play on your device. Not using the correct codec is what leads to the majority of device compatibility or playback issues. This issue is becoming less common as modern containers often include the required audio and video codecs needed to play the file.

Popular Codecs

XviD/DivX

DivX is a commercially sold codec, while XviD is an open source utility meant to function as an alternative to its commercial cousin. Both codecs can decode the output of the other, as they are both built on the implementation of MPEG-4. While still widely used, its often strictly for video encoding and in conjunction with one of the more popular packs mentioned below.

MPEG-4

MPEG-4 is the most common streaming format and it consists of many parts, of which only MPEG-4 Part II is used for video coding. MPEG-4 Part II calls on video encoders such as DivX or XviD in order to encode the video, while audio is typically carried in MP3 format. Modern updates to MPEG-4 are now using H.264 as well.

H.264

This is the most popular choice for high definition material. H.264 is also a relative Swiss Army knife of the codec world as it can utilize both lossy and lossless compression depending on the settings you choose when encoding, such as frame rate, quality, and target file size. H.264 relies on x264 for encoded video (as well as others, such as DivX or XviD), and audio is often encoded using AAC or MP3 audio codecs depending on the size and quality you’re targeting.

H.264 is touted as 1.5 to 2 times as efficient as basic MPEG-4 compression, which leads to smaller file sizes and seamless playback on more devices. That said, H.264 is now included in the MPEG-4 codec (part 10, known as AVC), so it could become a moot point in the near future as the codecs become less reliant on a single encoding technology, and instead take on the role of a codec pack which includes multiple encoding methods in a single package.

video-compression-codec

What is a Container?

A container exists solely for the purpose of bundling all of the audio, video, and codec files into one organized package. In addition, the container often contains chapter information for DVD or Blu-ray movies, metadata, subtitles, and/or additional audio files such as different spoken languages. The typical container runs like an executable (.exe) file on Windows. It uses a .bat file to tell the operating system that there are executable commands that need to be run together in order to achieve the intended result.

Popular Containers

Flash Video (.flv, .swf)

Macromedia originally created Flash before they were ultimately acquired by Adobe in 2005. Flash is an aging container that is being phased out due to limitations in the technology, creating what Steve Jobs used to refer to as “buggy” file handling. This led to a very public omission from iOS devices for Adobe and it appears that this was the beginning of the end for the format. As HTML5 standardization takes hold Get Started With HTML5 Get Started With HTML5 You’ve heard of HTML5. Everybody is using it. It's being heralded as the savior of the Internet, allowing people to create rich, engaging web pages without resorting to using Flash and Shockwave. Read More , we should see less Flash videos online, and the container is most likely going to disappear with it.

youtube-tablet-laptop

MKV

MKV is a rapidly growing format that was designed to be future-proof. The container itself supports almost any audio or video format which makes it adaptable, efficient, and highly regarded as one of the best – if not the best – ways to store audio and video files. In addition, it even supports multiple audio, video and subtitle files even if they are encoded in different formats. Due to the options the container offers, as well as its handling of error recovery (which allows you to play back corrupted files), it has quickly become one of the best containers currently available.

MP4

MP4 is the recommended format for uploading video to the web Everything You Need To Know About Uploading Videos To YouTube Everything You Need To Know About Uploading Videos To YouTube One of the best websites that we have available to us is YouTube. You can find a vast amount of content from useful information to cute and funny videos, like kittens. So what if you... Read More , and services such as Vimeo and YouTube have it listed as their preferred format. The MP4 container utilizes MPEG-4 encoding, or H.264, as well as AAC or AC3 for audio. It’s widely supported on most consumer devices, and the most common container used for online video. You really can’t go wrong with MP4.

The bottom line is, a container is a (mostly) useless bit of information when referring to video. Telling someone to send you an MP4 file doesn’t give away any useful bits of information without understanding how the video and audio itself were encoded. The container is just that, a place to store the audio, video and the codecs needed to decode them for playback.

So, ultimately if you’re looking for advice on what to use, H.264 is quickly becoming the standard codec, while either mp4 or MKV are worthy containers. MP4 might get the edge here because it is better supported in consumer devices, and is the standard for most large streaming video sites. Ultimately, the choice is yours, and as long as the video can be decoded and played on the other end, there really aren’t a lot of bad choices you can make in terms of what to use.

I’d love to hear what you use and for which application you’re using it for. What are your go-to video compression codecs, settings, and containers The Best Settings & Formats for Capturing Videos for YouTube The Best Settings & Formats for Capturing Videos for YouTube Read More ? Let us know in the comments below.

Photo credit: compression tool Via Shutterstock, Tunnel of Images, Media, Photographs via ShutterstockAmazing Nature by Dr. Wendy Longo (modified), Adobe Media Encoder CS4 by Kebman, Youtube by Esther Vargas all via Flickr

Leave a Reply

Your email address will not be published. Required fields are marked *