Try it free

← BlogEngineering7 min read

By Pritika Bakshi, Principal Video Streaming Engineer, creekX.io

Adaptive bitrate streaming: several qualities from one live, and the CPU it costs

Adaptive bitrate (ABR) means the server encodes one live input into several renditions (here 1080p as received, plus 720p, 480p and 360p) and publishes them in one HLS multivariant playlist; the player picks a rendition per segment from its measured throughput. The cost is all on the server: each extra rendition is a real-time encode, about 0.6 of a core per 1080p input for the three-rung ladder below.

How a ladder works

An ABR ladder from a 1080p live The 1080p source is passed through untouched. The server decodes it once and encodes three smaller copies: 720p, 480p and 360p. A master playlist lists all four; each player picks one and switches when its connection changes. 1080p live from the encoder 1080p · passed through decode 720p 480p 360p master playlist fibre → 1080p 4G → 720p / 480p weak signal → 360p encoding: where the processor goes
Only the smaller copies are encoded; the original passes straight through.

The player downloads a master playlist that lists every quality with its bitrate and size. It starts on one, measures how fast segments arrive, and moves up or down. Because every quality has its keyframes at the same moments, the player can switch at a segment boundary without stopping. Two rules make a ladder efficient:

What it costs, measured

On a 4-core laptop processor, we made 720p, 480p and 360p copies of a 1080p30 live with three different x264 presets, and measured the processor while someone was watching:

Processor cost of three smaller copies, by x264 preset Making 720p, 480p and 360p copies of a 1080p30 live: ultrafast 1.1 cores, superfast 2.3 cores, veryfast 2.6 cores. ultrafast superfast veryfast 1.1 cores 2.3 cores 2.6 cores 720p + 480p + 360p from 1080p30, measured on an i5-11300H laptop
The preset more than doubled the cost for copies most viewers watch on a phone.

Ultrafast produces slightly larger files for the same quality. In return it keeps up: in a separate test on the same busy laptop, a 1080p encode on veryfast ran at only 0.83× real time, and in live video that means a backlog that only grows. For small copies watched on phones, the trade is clearly worth it.

The creekX Server screen: processor, memory and disk gauges, data going out, a memory leak watch and background work
The Server screen shows the processor a ladder costs, live. creekX dashboard (demo footage: Sintel and Big Buck Bunny, Blender Foundation, CC BY 3.0).

Plan for it

And WebRTC?

WebRTC adapts differently: the sender changes its bitrate, or sends several layers at once (simulcast). In creekX, WebRTC viewers get the original quality with sub-second delay, and the ladder serves HLS viewers. Sizing the rest of the server is covered in how to size a streaming server.

Turning it on

Per stream in the app, or from code with one flag. HLS viewers then get the ladder; WebRTC viewers are unchanged:

curl -X PATCH https://live.example.com/v1/streams/STREAM_ID \
  -H "X-CreekX-Key: YOUR-API-KEY" -H "content-type: application/json" \
  -d '{"qualities":true}'

The master playlist creekX served for our 720p test camera with this turned on (real output). The 720p original passes through; 480p and 360p are the copies:

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-STREAM-INF:BANDWIDTH=3064776,AVERAGE-BANDWIDTH=2730387,RESOLUTION=1280x720
index_0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1709546,AVERAGE-BANDWIDTH=1443840,RESOLUTION=854x480
index_1.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1056058,AVERAGE-BANDWIDTH=921618,RESOLUTION=640x360
index_2.m3u8

In creekX: turn on Several qualities for viewers in Settings. 720p, 480p and 360p are made only when smaller than the live, and only while someone watches by HLS. Try it free.

Frequently asked questions

What is adaptive bitrate streaming?

Publishing the same video in several qualities so the player can pick the best one the viewer’s connection can sustain, switching up or down while it plays.

How much CPU does an ABR ladder need?

It depends on the encoder preset and resolutions. In our measurement, three smaller copies of a 1080p live (720p, 480p, 360p) took about 1.1 cores with x264 ultrafast and about 2.6 with veryfast.

Does WebRTC use adaptive bitrate too?

WebRTC adapts differently, through simulcast or the sender changing bitrate. In creekX, WebRTC viewers get one quality and HLS viewers get the ladder.