HLS Live: Why the Playlist Keeps Sliding
この記事は中文と英語で提供されています。日本語訳は準備中です。
A VOD M3U8 is a complete playlist ending with #EXT-X-ENDLIST; a live playlist is a window that keeps sliding forward.
The sliding window
The live server keeps producing new segments and updates the playlist to hold "the most recent N segments". The player re-fetches it periodically and downloads anything new. There is no ENDLIST tag because the stream is still running. #EXT-X-MEDIA-SEQUENCE increments as the window advances so the player knows where it is.
Where latency comes from
End-to-end delay is roughly the sum of several parts: the time the encoder needs to produce a segment (segment length), the buffer the player keeps for smooth playback, and the playlist refresh interval. Traditional HLS often runs 10–30 seconds behind for exactly these reasons.
How to reduce it
- Shorten segments (for example, 1 second);
- Lower the player's buffer target;
- Use LL-HLS extensions (partial segments, incremental updates);
- Enable low-latency settings on the ingest and CDN sides.
Latency and stability often trade off against each other. A smaller buffer is more sensitive to network jitter, so real deployments need to balance the two.