Video formats decoded
Want to know your QuickTime from your HEVC? Darien Graham-Smith demystifies the popular video-sharing formats and codecs
While capturing and editing video is easier than ever, the fighting file formats are a pit of complexity. We’re asked to choose between AVI, MP4, H.264 and so forth, but what’s the difference between them?
Here’s everything you need to know to produce the best videos for your needs, whether you’re looking for smaller files, fast transcodes or the best possible quality.
The big picture
The fundamental reason why all these different formats exist is that each frame of video – in the form that we see on our screens – is huge. A single frame of Full HD video consists of 1,920 x 1,080 pixels, which is to say just over two megapixels. If each pixel were represented by a single bit, the full frame would represent over two megabits (that is, 250 kilobytes) of raw data.
And of course we don’t use one-bit video, as that would mean each pixel would only be either black or white. Most mainstream media uses a 24-bit colour palette, with eight bits representing each of the red, green and blue components for a palette of 16,777,216 colour tones. This allows for subtle colour gradients and shades that look (to the human eye) perfectly smooth, with no blocky aliasing. It also pushes up the raw size of the frame to 1,920 × 1,080 × 24 for a total of 49,766,400 bits. In other words, just under 50 megabits, or around 6.2 megabytes.
Then of course we need to think of the time domain. A typical Hollywood film will be shot at 24 frames per second, so one second of footage represents 49,766,400 × 24 bits for a total of 1,194,393,600 bits. That’s equivalent to around 150 megabytes per second, so a two-hour film equates to more than a terabyte of data. This is an inconveniently large amount of information to be working with. And that’s before we consider HDR media, which typically uses ten bits of colour data per pixel, or higher frame-rate media, shot at 30fps or even 60fps. 4K media is four times the pixels – and hey, you might like to include some sound with that video, too?
It’s clear that, for us to be able to edit, share and store video data on our personal devices, it needs to be compressed down to a manageable size – and this is where all the different file formats come in.
Containers and codecs