DEV Community

Alvin
Alvin

Posted on

Understanding Low-Latency Streaming: Where Delay Comes From and How to Reduce It

Low-latency streaming is about more than delivering video quickly. It is about minimizing the time between a real-world event and the moment viewers see it, while keeping playback stable.

For example, if a goal happens during a football match at 8:00 PM but appears on a viewer’s screen at 8:00:08 PM, the stream has an eight-second glass-to-glass delay.

According to IETF RFC 9317, low-latency live streaming generally targets less than 10 seconds of delay, while ultra-low-latency streaming targets less than one second. These are reference categories, not universal performance guarantees. The right target depends on the application and how much real-time interaction it requires.


Why Does Latency Matter?

A delay between the live event and playback can affect more than the viewing experience:

  • Information mismatch: Social updates, notifications, or live commentary may reveal an event before viewers see it.
  • Delayed interaction: In live commerce, auctions, and interactive broadcasts, delayed video can make audience responses feel disconnected from what is happening.
  • Different playback positions: Network conditions and player buffering can place viewers at different points in the same broadcast.

Reducing latency helps keep video closer to real-time events. However, lower latency alone does not guarantee that every viewer will be synchronized.


Where Does Streaming Latency Come From?

End-to-end latency accumulates across several stages of a live streaming workflow.

  1. Capture: Cameras and microphones convert the event into digital audio and video. Frame capture, hardware processing, and synchronization introduce initial delay.
  2. Encoding: Raw video is compressed using a codec such as H.264 or HEVC. Encoding settings, including lookahead, frame reordering, and GOP structure, affect how quickly frames become available.
  3. Ingest and transmission: The encoded stream travels from the broadcaster to a media server or streaming platform. Network distance, congestion, and packet loss can add delay. Retransmissions and recovery mechanisms may increase it further.
  4. Transcoding and packaging: A platform may create multiple resolutions and bitrates for adaptive bitrate (ABR) playback, then package the media into formats such as HLS or DASH. With conventional segment-based streaming, the player may need to wait until a complete segment is available before retrieving it.
  5. Distribution and playback: A CDN delivers media toward viewers. The player buffers and decodes the stream before displaying it. Buffering improves resilience to network fluctuations, but a larger buffer also increases the distance from the live edge.

The contribution of each stage depends on the architecture and configuration. In conventional segment-based workflows, packaging and player buffering can be particularly significant sources of delay.


How Is Live Streaming Latency Measured?

The primary end-to-end metric is glass-to-glass latency: the time between an event happening in the real world and its corresponding video appearing on a viewer’s screen. It includes capture, processing, network delivery, buffering, decoding, and display.

It is useful to distinguish this from other metrics:

  • Network latency measures the time data takes to travel across a network. It does not include encoding or playback delays.
  • Round-Trip Time (RTT) measures the time for a packet to reach its destination and for a response to return. It indicates network responsiveness, not total streaming delay.
  • Startup latency (Time to First Frame) measures the time from pressing Play to seeing the first frame. A stream can start quickly and still be tens of seconds behind the live event.

A fast startup does not necessarily mean low live latency. Measuring glass-to-glass delay is essential when evaluating how close playback is to the actual event.


When Is Low-Latency Streaming Needed?

Low-latency streaming is particularly important for applications where viewers need to follow live events or interact in real time.

Common use cases include:

  • Sports and live events: Keep video closer to live commentary, scores, and social updates.
  • Live commerce and auctions: Help viewers respond to product demonstrations, changing offers, and bidding activity in time.
  • Interactive creator streams and cloud gaming: Support audience participation and responsive gameplay.
  • Video conferencing: Enable natural, real-time conversations with minimal delay.

Not every application requires ultra-low latency. One-way live broadcasts with limited interaction may tolerate delays of 10 seconds or more, allowing larger playback buffers for better stability. The appropriate latency target depends on the application's requirements.


How to Reduce Live Streaming Latency

Reducing latency requires optimizing the full workflow rather than focusing only on network speed.

1. Define a latency target and measure each stage.

Set a glass-to-glass target based on the application. Sports broadcasts may tolerate several seconds, while video conferencing requires much faster response. Measure encoding, ingest, transcoding, packaging, distribution, and playback to identify the main bottlenecks. Track results over time rather than relying on a single measurement.

2. Optimize encoding and processing.

Use low-latency encoder modes where available. Avoid unnecessary lookahead and B-frame reordering, which can require frames to be held before output. Shorter GOP intervals provide more frequent keyframes and can reduce waiting when viewers join or switch bitrates. However, they may increase bitrate and delivery costs, so balance latency with compression efficiency. Avoid unnecessary transcoding steps as well.

3. Choose suitable ingest and delivery protocols.

SRT and WebRTC-based ingest using WHIP can support low-latency first-mile transmission over unpredictable networks. For viewer delivery, WebRTC suits interactive applications, while LL-HLS and LL-DASH offer scalable HTTP-based delivery. Appropriate segment and chunk durations also help reduce waiting time.

4. Optimize CDN delivery.

Edge infrastructure can bring media closer to viewers and reduce reliance on a centralized origin. Routing, ISP connectivity, and traffic distribution also matter. However, CDN proximity alone does not guarantee low glass-to-glass latency. The CDN must deliver LL-HLS partial segments or CMAF chunks without holding them until full segments are complete. WebRTC deployments need infrastructure capable of handling real-time transport and expected audience capacity.

5. Tune player buffering.

A larger buffer absorbs network fluctuations but increases live delay. Configure an appropriate live-edge target and reduce unnecessary buffering without making it too small. Some players can adjust playback speed to catch up when they fall behind. The goal is to balance latency with rebuffering risk and playback stability.


A WebRTC Delivery Example

CDNetworks also provides a WebRTC-based Low Latency Streaming solution, supporting glass-to-glass latency below 500 milliseconds and more than one million concurrent viewers.

The solution supports two ingest-to-playback workflows.

With RTMP ingest to WebRTC playback, broadcasters can continue using existing encoders such as OBS or FFmpeg. Since RTMP streams commonly use AAC audio while WebRTC playback requires Opus, the audio is converted from AAC to Opus in the cloud before delivery.

For a more direct WebRTC workflow, broadcasters can publish streams through WHIP (WebRTC-HTTP Ingestion Protocol), while viewers receive them through WHEP-compatible players or a lightweight HTML5 player.

The solution also supports real-time transcoding to generate multiple resolutions and bitrates for different devices and network conditions. This is one example of how WebRTC delivery, audio format conversion, and real-time transcoding can work together in a low-latency streaming setup.


Conclusion

Low-latency streaming is an end-to-end engineering problem. Capture, encoding, transport, packaging, CDN delivery, and player buffering all contribute to the final delay.

The best approach is to define a latency target based on the application, measure where delay accumulates, and choose protocols and configurations accordingly. WebRTC is suited to sub-second interaction, while LL-HLS and LL-DASH provide lower-latency options for scalable HTTP delivery.

Ultimately, the goal is not simply to make video as fast as possible. It is to deliver media close enough to real time while preserving a stable viewing experience.

Top comments (0)