Codecs, containers and bitrate — how it all fits together
‘A video in MP4’ tells you nothing about quality. MP4 is a wrapper. Quality, size and how smoothly it edits are decided by the codec, its settings and the data rate.
Container vs. codec
A container (MOV, MP4, MXF, MKV) is a file format: it wraps one or more tracks of picture, sound, subtitles and timecode, keeps them in sync and carries metadata. A codec determines how the data in an individual track is compressed. The same container can carry different codecs, and the same codec can sit in different containers.
DIAGRAM · WHAT’S INSIDE THE FILE
That is why ‘the MP4 won’t play’ can happen: the player knows the container but not the codec inside (HEVC or AV1 on an older device, for example).
Intra vs. long-GOP
Codecs compress the picture in two ways:
- Within a frame (intra). Each frame is compressed on its own, like a photograph. Apple says of all ProRes codecs that they are ‘frame-independent’ — each frame is encoded and decoded independently. DNxHR works the same way. Files are larger, but the editing software can jump to any frame without calculating the ones around it.
- Between frames (long-GOP). The codec stores a complete key frame (I) and then only the differences: P frames are predicted from previous frames, B frames from both previous and following ones. The group from one I frame to the next is the GOP. At the same quality the files are much smaller — which is why distribution works this way (H.264, H.265, AV1). When editing, though, the computer has to decode other frames to display a single one, which slows playback down with 4K and several tracks.
H.264 and H.265 also have all-intra profiles, used by some professional cameras. So the name of the codec alone doesn’t tell you whether it is long-GOP; you need to look at the profile.
Bit depth and chroma subsampling
Bit depth determines the number of levels per channel: 8 bits = 256, 10 bits = 1,024, 12 bits = 4,096. For log recording and grading, 10 bits is a sensible minimum.
Chroma subsampling exploits the fact that the eye is more sensitive to brightness than to colour. The J:a:b notation tells you how many colour samples there are relative to luminance samples in a block of 4 × 2 pixels:
| Format | Colour resolution | Where you will meet it |
|---|---|---|
| 4:4:4 | full | ProRes 4444, DNxHR 444, graphics, VFX, mastering |
| 4:2:2 | half horizontally | professional recording, ProRes 422, DNxHR, broadcast |
| 4:2:0 | half horizontally and vertically | distribution (YouTube recommends 4:2:0 for H.264 uploads), many cameras and phones |
In normal viewing you often won’t see a difference between 4:2:2 and 4:2:0. In keying (green screen) and heavy grading you will — edges and fine colour transitions break up sooner.
Bitrate and file size
The data rate (bitrate) is the amount of data per second. File size is simply:
size [B] = data rate [b/s] × duration [s] ÷ 8
Example: 100 Mb/s × 3,600 s ÷ 8 = 45,000,000,000 B = 45 GB per hour.
With CBR (constant bitrate) the result is exact. With VBR (variable bitrate) the encoder gives more bits to demanding scenes and fewer to simple ones — the final size is close to the average, not exact. ProRes is VBR with a target number of bits per frame; Apple says the maximum is about 10% above the target and many simple frames are smaller. DNxHR has a fixed number of bytes per frame for each level and resolution, so its data rate can be calculated exactly.
INTERACTIVE · STORAGE CALCULATOR
Storage calculator
- per minute
- —
- per hour
- —
- data rate
- —
- per frame
- —
| Codec | Mb/s | GB / hour | Source |
|---|---|---|---|
| ProRes 422 Proxy | 151 | 68 | Apple, 25p table |
| ProRes 422 LT | 342 | 154 | Apple |
| ProRes 422 | 492 | 221 | Apple |
| ProRes 422 HQ | 737 | 332 | Apple |
| ProRes 4444 (no alpha) | 1,106 | 498 | Apple |
| DNxHR LB | 149.9 | 67.5 | Avid: 749,568 B/frame |
| DNxHR SQ | 481.7 | 216.8 | Avid: 2,408,448 B/frame |
| DNxHR HQ / HQX | 728.3 | 327.7 | Avid: 3,641,344 B/frame |
| DNxHR 444 | 1,457.4 | 655.8 | Avid: 7,286,784 B/frame |
| H.264 upload (YouTube, SDR) | 35–45 | 15.8–20.3 | YouTube recommendation for 2160p |
The DNxHR values are calculated from bytes per frame: bytes × 8 × 25 ÷ 10⁶. Avid also gives them in MB/s in its table (e.g. 57.42 MB/s for UHD SQ at 25 fps — in binary megabytes). Here GB per hour is calculated in decimal (10⁹ B).
Which codec when
| Stage | Goal | Typical choice |
|---|---|---|
| Recording | As much information as you can afford to store | RAW, ProRes 422 HQ / 4444, 10-bit H.265 or H.264 intra in camera |
| Editing | Smooth playback | An intra codec (ProRes, DNxHR); with long-GOP originals, proxies (ProRes Proxy, DNxHR LB) |
| Exchange / mastering | No loss of quality across several generations | ProRes 422 HQ / 4444 (XQ), DNxHR HQX / 444, or uncompressed or IMF as the recipient requires |
| Upload to a platform | A high-quality source for re-encoding | H.264 or H.265 at a high data rate; some platforms also accept ProRes |
| Delivery to the viewer | A small file, wide support | The platform re-encodes it itself (often H.264, VP9 or AV1 depending on the device) |
Every re-encode with a lossy codec loses something. So export from the master file straight to the target format — not ‘from MP4 to MP4’.