Lesson 2 of 9 · 27m
Encoding Ladders, Codecs, and Keyframe Alignment
Design bitrate ladders that match content and devices, choose codecs pragmatically, and avoid the transcoding mistakes players feel immediately.
A bitrate ladder is not a table you copy from a blog post. It is a compression budget negotiated among content complexity, device capability, network reality, and cost. I have seen a beautifully engineered ladder waste millions of encoding hours because every rendition was the wrong shape for the audience. The senior move is to start with playback evidence, not encoder defaults.
The ladder is a product surface
A simple ladder might look like this:
rendition resolution video bitrate target use
low 426x240 400 kbps congested mobile
sd 640x360 900 kbps mobile data
hd-ready 1280x720 2.8 Mbps normal broadband
full-hd 1920x1080 5.5 Mbps large screens
high-hd 1920x1080 8 Mbps high-motion premiumMore renditions are not automatically better. Every rung adds encode cost, storage, packaging complexity, cache fragmentation, and decision noise. Sparse ladders cause visible jumps; dense ladders can thrash when bandwidth fluctuates. You are shaping both quality and player behavior.
Keyframes control switching, seeking, and packaging
Bitrate switching requires common segment boundaries. Seeking usually lands on keyframes. HLS and DASH segmentation is easiest when every rendition inherits the same keyframe cadence. Force it deliberately:
ffmpeg -i input.mov -c:v libx264 -preset veryfast -profile:v high -g 48 -keyint_min 48 -sc_threshold 0 -b:v 2800k -maxrate 3100k -bufsize 6200k -c:a aac -b:a 128k -f mp4 ladder-720p.mp4-sc_threshold 0 prevents the encoder from inserting extra scene-cut keyframes at different moments in different renditions. That feels counterintuitive because scene cuts are good compression opportunities, but uncontrolled keyframe placement destroys clean alignment. Controlled chunked encoding can reintroduce scene awareness inside a deterministic cadence; do not improvise it in the final packager.
H.264 is compatibility; HEVC and AV1 are economics
H.264 remains the floor for broad device support. HEVC can reduce bitrate meaningfully on supported devices but carries licensing and platform constraints. AV1 often provides excellent compression but encoding cost is high and hardware decode support varies. A pragmatic ladder keeps H.264 universal and adds premium codecs where device telemetry proves they will actually be used.
Resolution is not the same as quality
A noisy sports feed at 1080p can look worse than a clean encode at 720p if both are starved for bits. Content-adaptive encoding analyzes complexity per title or per scene. Even without a full per-title system, classify content:
talking head / slides low motion, sharp text
animation flat areas, sharp edges
sports high motion, grain, fast camera movement
film grain intentionally noisy, expensive to compress
screen capture text legibility dominatesThe right question is not "what bitrate is HD?" It is "at what bitrate does this class stop showing objectionable artifacts on the devices our audience uses?"
Audio is cheap; mistakes are not
Viewers forgive small visual artifacts faster than audio dropouts, clipping, or lip-sync drift. Keep audio loudness and channel layout consistent across renditions. Players hate audio configuration changes mid-stream far more than a video bitrate change.
Field notes
- Validate output with a decoder, not only a muxer. A file can package successfully and still fail on hardware players.
- Record exact encoder versions. Bitrate ladders drift silently after upgrades.
- Use constant keyframe cadence across renditions unless you genuinely control the entire packaging chain.
- Do not ship AV1 because it is fashionable; ship it because playback mix and compute cost make the trade worth it.
Was this lesson helpful?