Learning how to build an encoding ladder is one of the most fundamental tasks for a streaming media professional. It’s astounding how much you need to know to get it right.
By way of background, the original encoding ladder used by most professionals was from Apple Tech Note TN2224, long since replaced by Apple’s HLS Authoring Specifications. This H.264-only ladder had defined rungs, resolutions, and bitrates, and was the starting point for a startling array of encoding ladders used around the web. I’ve always loved Beamr’s image that showed TN2224 at the center of the Rosetta Stone for working with encoding ladders.
Since Apple replaced TN2224 back in 2017, learning how to build an encoding ladder has gotten much more complicated, and the discrete bits of knowledge you need to know to get it right have ballooned. Here’s an example; a simple five-rung HEVC live encoding bitrate ladder produced in FFmpeg.
ffmpeg -y -re -i input.mp4 \
-c:v libx265 -preset ultrafast -x265-params keyint=60:min-keyint=60:scenecut=0:bitrate=6000:vbv-maxrate=6000:vbv-buf-size=6000:open-gop=1 out_1080p_6MB_x265.mp4 \
-c:v libx265 -preset ultrafast -x265-params keyint=60:min-keyint=60:scenecut=0:bitrate=4000:vbv-maxrate=4000:vbv-buf-size=4000:open-gop=1 out_1080p_4MB_x265.mp4 \
-c:v libx265 -s 1280x720 -preset ultrafast -x265-params keyint=60:min-keyint=60:scenecut=0:bitrate=2500:vbv-maxrate=2500:vbv-buf-size=2500:open-gop=1 out_720p_2_5MB_x265.mp4 \
-c:v libx265 -s 960x540 -preset ultrafast -x265-params keyint=60:min-keyint=60:scenecut=0:bitrate=1200:vbv-maxrate=1200:vbv-buf-size=1200:open-gop=1 out_540p_1_2MB_x265.mp4 \
-c:v libx265 -s 640x360 -preset ultrafast -x265-params keyint=60:min-keyint=60:scenecut=0:bitrate=800:vbv-maxrate=800:vbv-buf-size=800:open-gop=1 out_360p_800kb_x265.mp4
Below are links to pages discussing all the topics you need to know to get right. Explicit choices are decisions shown in the encoding ladder. Implicit choices are choices made by default in the encoding ladder. Other choices not discussed are issues worth being aware of that may not be reflected in the encoding ladder.
I review the decisions individually on separate pages; pages without links mean the page isn’t complete. Most of these are links to articles I’ve written; over time, I’ll convert them to more concise articles for each subject.
- Choosing a video codec
- Choosing the top rung bitrate
- Choosing the frame rate
- Choosing the maximum rate and buffer size
- Choosing a preset (x265, x264)
- Choosing the number of rungs
- Choosing the bitrate for each rung
- Choosing the bitrate distribution technique
- Choosing the maximum bitrate for VBR
- Setting the VBV buffer
- Choosing the resolution for each rung
- Choosing a keyframe interval
- Open or closed GOP
- Scaling techniques for ladder rungs
- Choosing the number of rungs
- Choosing the output format
- Choosing an audio codec (slide 14)
- Choosing the color depth
Other choices not discussed:
- Digital Rights Management (DRM)
- High Dynamic Range signaling
- Static ladder or per-title encoding
- Choosing an ABR technology
I’m sure I missed at least a few decisions; let me know at [email protected].
How to Build an Encoding Ladder: General Resources
Here are some general resources for encoding ladder creators; some are mentioned in the above links, some are not.
Encoding Ladders: What You Need to Know, Wowza Blog, August 2022
Creating the Perfect Encoding Ladder, OTTVerse, April 2022
Which Low-Res Rungs are Essential to an Encoding Ladder, LinkedIn October 2021
How Many Rungs on Your Encoding Ladder? (YouTube Video, 2021)
The Evolving Encoding Ladder: What You Need to Know (Streaming Learning Center, May 2019)
Five Checks on Your Encoding Ladder, Streaming Learning Center, August 2017