Try it free

← BlogProtocols8 min read

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

Low-latency HLS in practice: setup, players and the delay you really get

HLS plays everywhere and caches beautifully, but classic HLS runs many seconds behind live. Low-latency HLS (LL-HLS) keeps everything good about HLS and cuts most of that wait. Here is how it works, and what it delivered when measured.

Why ordinary HLS is slow

HLS cuts video into segments, typically 2 to 6 seconds long, and lists them in a playlist. A segment can only be listed once it is finished, and players usually hold two or three segments in hand before starting. Add those up and 6 to 30 seconds of delay is normal.

What LL-HLS changes

Segments versus parts Ordinary HLS publishes a whole 2-second segment before a player can fetch it. Low-latency HLS publishes 200-millisecond parts of the segment as they are made, and the player asks for the next part before it exists, the server answering as soon as it does. HLS segment 1 (2 s), listed when complete segment 2 LL-HLS each part (0.2 s) is listed the moment it is written player: "send me the next part" server holds the answer until it exists
Parts and blocking playlist reloads let the player stay close to the edge of live.

Measured delay

We stamped a clock into every frame, sent it the way a tuned OBS would, and read it back in a real browser, so each number is the whole delay from camera to screen:

Measured median delay by way of watching WebRTC 0.49 seconds. Low-latency HLS with the player aiming 1 second behind live: 1.23 to 1.28 seconds. Ordinary HLS: 3.4 to 3.8 seconds. WebRTC Low-latency HLS Ordinary HLS 0.49 s ≈1.25 s 3.4–3.8 s medians, 1080p30 with keyframes every 1 s, measured on a 4-core laptop
LL-HLS is not WebRTC, but it is close enough for chat, Q&A and most sport.
The Play with switch on a creekX stream: HLS, every device, a few seconds behind; or WebRTC, real time, under a second
Every stream offers both, and the viewer page picks for each device. A real The creekX dashboard (demo footage: Sintel and Big Buck Bunny, Blender Foundation, CC BY 3.0).

Three traps we hit

1. Aiming too close to live

Letting the player sit right at the playlist's 0.5 s hold-back was faster on most runs, 0.8 to 1.1 seconds. But once it started slowly, settled 2.9 seconds behind and never caught up. Aiming 1 second behind, and jumping forward if it ever falls 3 seconds behind, gave steady results run after run.

2. Apple devices want https

Low-latency HLS is meant to be served over https for Apple devices to handle it properly. Serve the playlist and parts from the same https address as your site.

3. Not every player can do it

Some older built-in players cannot send the authorisation a private stream needs, or do not speak LL-HLS at all. Give them ordinary HLS as a fallback rather than a blank screen.

When to use which

Need Use
Bidding, betting, two-way talk, camera control WebRTC
Events with live chat, sport, classes LL-HLS
Huge audiences through a CDN, 24/7 channels HLS (with several qualities)

What a low-latency playlist looks like

The low-latency playlist a creekX server served for a live stream (real output, the head and the newest lines):

#EXTM3U
#EXT-X-VERSION:10
#EXT-X-TARGETDURATION:2
#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,PART-HOLD-BACK=0.52250,CAN-SKIP-UNTIL=12.00000
#EXT-X-PART-INF:PART-TARGET=0.20900
...
#EXTINF:1.25000,
0973fb73d039_video1_seg12.mp4
#EXT-X-PART:DURATION=0.20900,URI="0973fb73d039_video1_part42.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.20800,URI="0973fb73d039_video1_part43.mp4"
#EXT-X-PRELOAD-HINT:TYPE=PART,URI="0973fb73d039_video1_part44.mp4"

PART-TARGET is the part length, CAN-BLOCK-RELOAD lets the player wait on the server, PART-HOLD-BACK is how close to live it may play, and PRELOAD-HINT names the next part before it exists.

In creekX: every stream is served by WebRTC, LL-HLS and HLS at once, and the website player picks the best one each viewer can use. See putting the player on your website and WHIP and WHEP.

Frequently asked questions

What is low-latency HLS?

An extension of Apple’s HLS where segments are published in small parts (for example 200 ms) and players can block on playlist updates, bringing delay down from many seconds to around one to three.

Is LL-HLS as fast as WebRTC?

No. In our measurements WebRTC ran about 0.5 s behind live and LL-HLS about 1.25 s. LL-HLS is easier to scale and cache, so many services use both.

Does LL-HLS need https?

For Apple devices, yes: low-latency HLS is meant to be served over https to work correctly on them.