What you need to know about Common Video Formats and Codecs

Whenever we talk about video formats, there are a few things we might be talking about: video standards, container and codec. This article is to demystify everything.

Video Standards

This is the established video standard. For example, 4K, 2K, HD, HD 720, PAL and NTSC. It is usually a combination of video resolution in terms of pixel and the frame rate.

Standard Definition Video

Standard

Frame size

Frames rates

Scanning method

NTSC

720 x 486

29.97

Interlaced

PAL

720 x 576

25

Interlaced

High Definition Video

Standard

Frame size

Frames rates

Scanning method

720p

1280 x 720

23.98, 24, 25, 29.97, 59.94, 60

Progressive

1080p

1920 x 1080

23.98, 24, 25, 29.97, 59.94, 60

Progressive

1080i

1920 x 1080

25, 29.97, 59.94, 60

Interlaced

Video Codec

For video codec, it is the COmpressor – DECompressor of the video. Every second of a video can be up to 60 frames. That means for a HD video, every second, we are talking about 60 * 1920 x 1080 pictures. That is a lot of bits to be stored in the HDD and streaming over the Internet.

Hence most video formats that we see, will be 'compressed' in some form, and 'decompressed' when the viewer actually watch it. The video codec is the algorithm for how the video is 'compressed' and 'decompressed'.

Video Container

This is like the 'holder' of the video file. Usually there are some codecs that are commonly associated with a video container.

Let's start with the most common container format. If there are only 3 video containers / codecs you need to know, here are the three.

The three most common ones are what you will encounter on Internet. They are HTML5 video codecs. By encoding your videos to these three formats, you can be assured it is viewable on almost all modern browsers. (Yes, different web browsers playback only selected video codecs).

MPEG4 (.mp4)

MPEG4 is a container format and for HTML5 video, it is usually using the H.264 codec.

H.264 is a highly popular codec for final delivery because of its highly efficient interframe encoding and widespread compatibility. Most modern Mac and PC can playback this codec natively. And of course all iPhones. It is usually wrapped in a .mp4 container.

WebM (.webm)

WebM is usually a container format for the VP8 codec (open and royalty-free by Google). It's also a highly efficient lossy codec, aimed at final delivery. There is a newer VP9 successor, also wrapped in the .webm container. However, browser support for the new VP9 is still limited.

Ogg / Ogv

Ogg is a free, open container format for the Theora video codec and Vorbis audio codec. Ogg and Ogv are similar container formats, but Ogg and Ogv are sometimes used to store audio files only. They are also highly efficient interframe lossy codecs, targeted for final delivery usage.

Latest Codecs

As we demand higher resolution (4K, 8K), faster frame rate (HFR), and deeper tones (HDRI) our video file sizes get larger. And we need even better codecs to deal with it. Here are some future codecs.

HEVC (High Efficiency Video Coding)

HEVC, also known as H.265, is a successor to the popular H.264. It almost doubles the compression efficiency, meaning that for the same compressed quality, you can store it at half the file size. It is popular for 8K video content but there is still limited browser support for it.

VP9

A successor to the WebM VP8 and is supported by most of the latest browsers. Older browsers though, have limited support for it. Unless we are targeting only the newest browsers, we will have to wait a while before encoding all our content to this format.

Other common video container formats for desktop

Some other common video container formats are avi, mov, wmv, flv. You can read our previous article to learn more about them.

Not all codecs are meant for delivery. Some codecs are meant for intermediate processing / editing.

Before we can talk about intermediate codecs, we need to explain about 'lossy' and 'lossless' codecs. 'Lossy' codecs will achieve very high compression ratios / efficiency; however, to do this, they will 'throw away' information from the video, never to be recovered. Most of these information will be invisible to the naked eye. However, as the compression rate increases, more of it will be visible, for example, we will start to see 'blocks' (technically known as 'artifacts') appearing on the video. Nevertheless, some modern 'lossy' codecs are able to provide a 'visually similar' video, while offering a very high compression rate.

If we are editing a video, we will definitely like to 'preserve' as much information as possible in the video file. This is so to ensure we can still adjust or change the color of the sky, or bring up the brightness of the face. If we use a 'lossy' codec, we would have 'thrown away' the additional information and make it more difficult to change the color of the sky or increase the brightness of the face. This is where 'lossless' codecs come in. 'Lossless' codecs mean that there is no information loss from the compression-decompression process. If you compare the pixels before and after, they would be 100% similar.

Intraframe vs Interframe

There is another concept that we need to explain. There are intraframe and interframe codecs. Intraframe means that the compression is done within the frame itself. Interframe is where compression happens across the frames. For example, in this video, the areas around the car will not change much. Hence it is more efficient to store the information at frame 1, then store only what changed in frame 2.

Common delivery formats will use this strategy to achieve the high compression ratio. However, when it comes to playback, there will be additional CPU processing that is needed to 'recreate' the entire frame 2.

Intermediate Codecs

Quicktime Animation (.mov)

Animation codec is a 'lossless' codec that uses a very simple (and fast) compression. It uses RLE, which means that it looks at a row of pixels and compresses pixels side by side that have the same color. It is good as an intermediate codec, for example in After Effects, because it preserves all the quality even after multiple renders and passes, and also decompresses fast, so scrubbing through the timeline is not laggy.

Quicktime PNG (.mov)

Quicktime PNG is stored in an Apple Quicktime container format. It offers 'lossless' compression, and allows you to store an alpha channel as well. An Alpha channel is additional channel in addition to the standard color RGB channel. An alpha channel stores information for which parts of the video is transparent and which part is opaque. Due to it's highly efficient compression, it means that decompression is slower. Unless storage is an issue, we do not recommend using it as a codec for After Effects or video editing. However, this codec is recommended if you want to archive your video files 'lossless'ly and save on HDD space.

At MotionElements, for videos that contain Alpha channels, we recommend our artists to upload in this format as it offers maximum quality as well as alpha channel storage.

Quicktime PhotoJPEG

This is a Quicktime codec that stores in Motion JPEG. For a 30 fps video it is like storing 30 frames for JPEG files and playing back one after another in a second. This codec is recommended for video editing, especially if you need it across Mac and PC platforms.

ProRes

ProRes is a popular codec by Apple for editing purposes. There are many variants, including ProRes LT, ProRes HQ, ProRes 4:4:4. This codec is highly recommended for video editing. However, if you need to move your files across Mac and PC platforms, this is not recommended as it works well on Mac, but… on PC.

DNxHD

This is a lossy codec by Avid. Probably no need to know if you don't already know this.

Acquisition Formats

Material eXchange Format (.mxf)

MXF is a 'container' format that is used for a variety of codecs. Designed by Society of Motion Picture and Television Engineers (SMPTE), it is primarily targeted at broadcast usage.

RED (.r3d)

This is the highest quality RAW codec for footage shot by the RED camera.

Example

Here is an example from a video element on MotionElements. We have converted it into different formats for your reference. Enter your email to download the videos FREE!

* By supplying your email, you authorize MotionElements to update you with information about its services. You may unsubscribe at any time.