Low-Latency HLS (LL-HLS) vs. Standard HLS: Tuning Segment Duration, GOP Length, and Keyframe Intervals
Reducing glass-to-glass live television delay from 18 seconds down to 3â5 seconds without sacrificing playback stability.
Key Engineering Takeaways
- Standard HLS historically suffered from 15â30 seconds of latency due to 6-second segments and a 3-segment player buffer requirement.
- Reducing encoder GOP (keyframe interval) to 1â2 seconds and segment duration to 2 seconds cuts latency to 4â6 seconds while remaining 100% CDN-cacheable.
- Tuning hls.js liveSyncDurationCount in the web player keeps viewers locked to the live edge.
1. Where Does Latency Come From in Live HTTP Streaming?
Every HTTP Live Streaming (HLS) pipeline introduces delay at three stages: encoder GOP accumulation, packager segment creation, and client player buffering. Because an HLS segment can only begin on an IDR keyframe, a 6-second segment duration forces the packager to wait 6 full seconds before publishing a single fileâand a player buffering 3 segments waits 18 seconds before rendering the first frame.
2. The 2-Second Sweet Spot for Global CDN Compatibility
In OnAir Playoutâs streaming architecture, engineered by the OnAirPlayout Engineering Team, we configure a locked 2-second IDR keyframe interval (-g 120 at 60fps) paired with 2-second HLS segments. This reduces end-to-end latency to ~4â5 seconds while allowing Global Broadcast CDN to cache complete segments with zero origin strain.
3. When to Use WebRTC WHEP vs. Edge-Cached HLS
Use WebRTC (sub-500ms latency) for internal studio confidence monitoring and return feeds for field reporters; use Edge-Cached HLS (4â5s latency) for public distribution to thousands of concurrent viewers.