Video Encoding Fundamentals
GOP, IDR frames, H.264 profiles, VP9, MP2TS, muxing.
Why this matters for CWIP
Video encoding is the part of an integration that breaks most subtly: licences flow correctly, the player negotiates correctly, and the stream still won't play because of a codec / profile / scheme mismatch. CWIP candidates are expected to be fluent in the vocabulary below.
Frame types
A GOP (Group of Pictures) starts at an IDR frame and ends just before the next IDR. Random access only works at GOP boundaries, which is why DASH/HLS segment durations are usually integer multiples of GOP length.
H.264 profiles
| Profile | Where used | Notes |
|---|---|---|
| Baseline / Constrained Baseline | Cheapest devices, fallback | No B-frames, basic features |
| Main | Mainstream phones / TVs | Adds B-frames, CABAC |
| High | Modern phones, smart TVs | Adds CABAC + 8x8 transform — most common today |
| High 10 / Hi10P | Niche / pro | 10-bit; not broadly supported |
For DRM:
- Premium content typically encodes at High @ L4.0 or higher.
- Some older / low-end devices only support up to Main; the player must adapt or fail gracefully.
VP9 and AV1
- VP9 — Google's royalty-free codec; widespread on YouTube and Android. Better compression than H.264. Widevine supports it.
- AV1 — newer, royalty-free, even better compression. Hardware decode support is expanding. Most DRM stacks now support AV1 in CENC.
Containers
- fMP4 (CMAF) — the modern standard. Fragmented MP4; works for DASH and HLS.
- MP2TS — older HLS default. Still in use for live; less DRM-friendly.
- WebM — used with VP9 in some browser-only contexts.
- MKV — rare in DRM streaming.
Encryption schemes vs codecs
| Scheme | Codec compatibility |
|---|---|
cenc (AES-CTR) | Works with H.264, H.265, VP9, AV1 |
cbcs (AES-CBC pattern) | Works with same codecs; required for FairPlay |
A common bug: a device's HW codec doesn't support cbcs for VP9, even though it does for H.264. Test the matrix.
Adaptive bitrate (ABR)
Streaming adapts to bandwidth by switching between representations at segment boundaries. For DRM:
- All representations in an adaptation set typically share encoding profile families.
- Per-resolution KIDs allow studio policies to gate higher bitrates by device tier — the player can only switch up if it has the corresponding key.
The relationship between GOP, IDR, segment duration, and random access is a stock exam topic. One sentence: segments must start with an IDR frame so each segment is independently decodable.