Low-Latency Live Streaming
Sources of Live Latency
Live streaming latency is the time差 between video capture and viewer display. Sources include:
- Capture latency: Camera/device processing time (milliseconds).
- Encoding latency: Time to encode a frame.
- 传输 latency: Data transfer from encoder to server to viewer.
- Segment latency: HLS needs enough data for a complete TS segment.
- Buffer latency: Players buffer segments before playback.
Traditional HLS Latency
Traditional HLS latency is 10-30 seconds. With 6-second segments and 2-segment buffer, segments and buffer alone add 12 seconds.
Low-Latency HLS (LL-HLS)
Apple released LL-HLS in 2019, reducing latency to 2-5 seconds through:
- Partial Segments: Smaller sub-segments for earlier playback.
- Preload Hints: #EXT-X-PRELOAD-HINT for提前 requests.
- Blocking Playlist Reload: Server blocks response until new content available.
Other Low-Latency Solutions
- WebRTC: UDP-based, 500ms-1s latency for small-scale互动.
- RTMP: 1-3s latency, requires Flash (deprecated).
- SRT: 1-2s latency for professional broadcast.