keepcalculator

06 Numbers and Powers

Low Latency Live Streaming: Practical Setup Guide

Card No. 06·40472 · Updated · Standard formula, shown below

This guide walks you through building a live stream with the lowest possible delay between what happens in front of the camera and what viewers see on their screens. You’ll learn how to choose the right protocol, configure your encoder, and optimize your network and player settings to achieve sub-second latency. No special hardware is required beyond a computer and a camera, but you’ll need a streaming platform or server that supports low-latency protocols.

What You’ll Need

  • A computer (Windows, Mac, or Linux) with a stable internet connection
  • A camera (built-in, USB, or HDMI capture device)
  • Streaming software (OBS Studio, vMix, or similar)
  • An encoder that supports low-latency protocols (most modern software encoders do)
  • A streaming destination that supports low-latency delivery (e.g., a CDN with LL-HLS or a WebRTC SFU)
  • Optional: a second monitor to monitor your stream

Step-by-Step

  1. Choose the right protocol. For the lowest latency, use WebRTC (under 500 ms) or SRT (around 1-2 seconds). If your audience uses standard HLS players, use LL-HLS (Low-Latency HLS) which can achieve 2-3 seconds. Avoid traditional RTMP/HLS which typically has 10-30 seconds of delay.
  2. Select a streaming platform that supports your chosen protocol. For WebRTC, you need a platform like Millicast or a custom SFU. For SRT, many platforms like YouTube and Facebook support it (though they convert to their own delivery). For LL-HLS, use a CDN that supports it (e.g., Akamai, Cloudflare).
  3. Configure your encoder settings. In OBS Studio, go to Settings > Output. Set the output mode to ‘Advanced’. Under Streaming, set the encoder to hardware (NVENC or AMF) if available, as it reduces encoding latency. Set the keyframe interval to 1 second (or every frame for WebRTC). Disable B-frames if possible, as they add latency.
  4. Set the correct resolution and bitrate. For low latency, use a resolution and bitrate that your internet can handle without buffering. A good starting point is 720p at 30fps with a bitrate of 2-3 Mbps. Lower latency requires lower bitrate to avoid congestion.
  5. Reduce buffering in the encoder. In OBS, go to Settings > Advanced. Set the ‘Stream Delay’ to 0. Ensure ‘Max Shutdown Time’ is set to a low value (e.g., 5 seconds). For SRT, set the latency to 500-1000 ms in the SRT plugin settings.
  6. Optimize your network. Use a wired Ethernet connection instead of Wi-Fi. Ensure your upload speed is at least 1.5x your bitrate. Close any bandwidth-heavy applications. If possible, use a router with QoS to prioritize streaming traffic.
  7. Configure the player for low latency. If you’re delivering via LL-HLS, the player must support it (e.g., hls.js with lowLatencyMode). For WebRTC, the player is typically embedded in the platform. If you’re using SRT, you’ll need a player that supports SRT or use a gateway to convert to LL-HLS.
  8. Test your stream. Do a test broadcast to a private channel. Use a second device to watch and measure the delay by showing a timer on screen and comparing it to your watch. Adjust settings if the delay is too high.
  9. Monitor and adjust. While live, keep an eye on the encoder stats (dropped frames, bitrate). If you see network issues, reduce bitrate or resolution. If latency creeps up, check for B-frames or excessive buffering.

Common Mistakes

  • Using RTMP with HLS delivery, which inherently has high latency (10-30 seconds).
  • Enabling B-frames in the encoder, which adds significant latency.
  • Setting keyframe interval too long (e.g., 2 seconds or more), which delays the start of playback.
  • Using Wi-Fi instead of Ethernet, causing packet loss and jitter.
  • Not testing the stream before going live, leading to unexpected delays.
  • Overloading the encoder with high resolution/bitrate that the internet connection can’t handle.

Tips

  • For WebRTC, use a hardware encoder if possible, as software encoding can add 100-200 ms of latency.
  • Keep your encoder software updated to the latest version to get optimizations.
  • If using OBS, enable ‘Low Latency Mode’ in the Advanced settings (if available).
  • Use a wired internet connection and ensure your upload speed is stable.
  • For SRT, set the latency to 120 ms per 1000 km of distance between you and the server.
  • Consider using a dedicated streaming PC to offload encoding from your gaming/working machine.
  • If your platform supports it, use ‘chunked’ encoding for LL-HLS to reduce segment duration.

Troubleshooting

  • Stream is buffering frequently: Lower your bitrate or resolution. Check your internet upload speed and ensure no other devices are hogging bandwidth.
  • Delay is still high (over 5 seconds): Verify you’re using LL-HLS or SRT, not standard HLS. Check encoder settings for B-frames or long keyframe intervals. Ensure the player is configured for low latency.
  • Video freezes or drops frames: Check your CPU/GPU usage. If it’s maxed out, lower the encoder preset or resolution. Also check for network packet loss using ping or a tool like WinMTR.
  • Audio and video out of sync: Ensure your audio sample rate is set to 48 kHz and matches the video. In OBS, use the ‘Sync Offset’ under Advanced Audio Properties to adjust.
  • Cannot connect to the streaming server: Check your firewall or router settings. Ensure the correct port is open (e.g., 1935 for RTMP, 8080 for SRT, 443 for WebRTC).
  • Viewers report high delay on mobile: Mobile players may not support LL-HLS. Consider using a platform that offers a dedicated mobile app with WebRTC.

Frequently Asked Questions

  1. What is the lowest possible latency for live streaming? WebRTC can achieve under 500 ms. SRT typically runs at 1-2 seconds. LL-HLS is usually 2-3 seconds. Traditional HLS is 10-30 seconds.
  2. Can I use OBS for low latency streaming? Yes, OBS supports SRT and can output to WebRTC via plugins. For LL-HLS, you need a separate packaging server or a platform that does it for you.
  3. Do I need a special camera for low latency? No, any camera that works with your computer is fine. The latency comes from encoding and network, not the camera.
  4. Why is my stream still delayed even with SRT? The delay may be added by the platform’s transcoding or CDN. Ensure the platform is not re-encoding to HLS. Also check your SRT latency settings.
  5. Is low latency streaming more expensive? WebRTC and SRT often require specialized servers or CDN services, which can cost more than standard RTMP. However, some platforms offer low latency as a built-in feature.
  6. Can I stream low latency to YouTube or Twitch? YouTube supports SRT input but converts to LL-HLS for viewers. Twitch uses a proprietary low-latency mode that reduces delay to around 2-3 seconds. Neither supports WebRTC.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →