Demystifying Codecs and Containers

Knowing the technical aspects of the video you are working with can be the difference between an easy typical day, or a mind-numbing day with unsolvable mysteries that has your work shut down. Here are some examples… You get sent a QuickTime .mov file and it plays back as just a white screen. Someone sends you an .avi file and you are a Mac user and you have no way to open the video file. Someone sends you a ProRez file and you are a Windows user and now you are stuck too. These are all common problems. Every day, video professionals work with different codecs, containers and formats and don’t really know much about them. The differences can seem unsubstantial, confusing and frustrating. Having a clearer understanding of how codecs and containers work can not only make troubleshooting easier, but help you avoid trouble all together.

There are four aspects of a video file. They are the audio, video, metadata and container. The audio and video are easy to understand, it is the images you see and the sounds you hear when playing a file. The metadata is information about the audio and the video. Some examples of basic metadata info are the name of the file, creation date, audio and video codecs used, frame rate, sample rate of audio, number of channels of audio, etc. The container is the file you click on your computer to present all of this info. So although you are clicking on something like “name-of-file.mov”, you are actually accessing all four aspects of the video file by clicking on the container file.

Let’s take a look at container files for a minute. What is a container file? A container file is something like an .avi, .mov, .mxf, .wmv, AVCHD or .mp4. It is a file you click on and play audio and/or video. Each container type has its pros and cons on usability. For example, the .mov is geared toward Macs where the .wmv is more geared toward Microsoft and Windows. AVCHD (developed by Sony and Panasonic) is pretty robust as a container, but unlike any other container file, it has a very specific folder structure that cannot be altered. This leaves .mp4 as the most widely compatible and easy to use container file, and because of this, it also makes it currently the most popular. The .mp4 container can be played on all operating systems, most mobile devices such as tablets and smart phones, and other places such as YouTube.

Think of the container file as a pizza chain that puts their name on their pizza box. In our example, we have a .MOV pizza. We know that .MOV Pizza has a wide menu and who knows what is in that pizza box. Its a pizza for sure, but we don’t know much more than that.
The codec is what determines how that pizza inside the box looks. The codec is a like a small computer program that creates the file. For our example, he can be the pizza chef. We know there is a pizza inside of a pizza box, but how was it prepared? Does it have toppings? Thin or thick crust? The codec/pizza chef will determine all that. There are too many codecs to mention in this article, but some of the common ones are .mp3, .aac, .mpeg2. ,mepg4, .h264 and soon coming .h265. In our example, our container (pizza chain) was .mov and our pizza chef and all the ingredients, crust and preparation were .h264 for video and .mp3 for audio.

Codec is short for compress/decompress. A codec is used to take huge uncompressed HD video and make it manageable to be stored and edited affordably. It does this by compressing the video and throwing away information to make it play back. There are two ways that this can be done. It can be done using an intra-frame codec or an inter frame codec. Intra-frame codecs are codecs such as ProRez and DNxHD. Inter frame codes are H264, H265, and Mpeg.

Despite the close pronunciation and spelling of these codec types, they are drastically different. In intra-frame codec will take individual each frame of video and compress each of them individually. In intra-frame codec will take a frame every few seconds and calculates the differences between the frames. Those frames are known as “I-frames”. Between two I-frames, the intra-frame codec will throw out any redundant pixels that are the same from frame to frame. The best use of intra-frame codecs are with talking head videos. The never-changing background of a talking head video is a great place to find redundant pixels. This makes intra-frame much more efficient with disk space, but the image quality will suffer for the image information you are throwing away to compress the file. This is also why editing .mp4 video can be so laggy and difficult. When you make a cut or edit in your video, if you don’t cut exactly in I-frame, the editing software needs to recalculate the intra-frame video and that’s what makes it so much less responsive. This is why editing software companies will persuade you into their codec. It’s because they use inter-frame codecs and aren’t using I-frames.

Hopefully understanding some of these differences will help you in troubleshooting in the future. There are a myriad of affordable applications out there that will pull all the video, audio and metadata info from your container files. Seek one out and see what you can find. It will save you time somewhere down the line.

Steve McGrath is a Broadcast Sales Engineer for HB Communications. He has worked with NBC, ABC, CBS, NESN, NECN, Fox, ESPN, Pentagon, Powderhouse and many others. You can reach him at: Steve.McGrath@HBCommunications.com.

Leave a Reply

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