Technical Guides

How to Measure Stream Latency: Check Your Delay on OBS, YouTube and Twitch

Saying a stream feels a bit behind does not help anyone fix it. A clock, two screens and five minutes give you a real number, and a few more checks tell you where the seconds come from.

What you are actually measuring

Latency, or delay, is the time between something happening in front of the camera and a viewer seeing it. Engineers call the full trip glass-to-glass: from the camera lens to the viewer's screen. It is the only latency your audience feels, so it is the number to measure first.

Two other figures often get mixed up with it. Time to first frame is how long the player takes to show video after someone presses play: a stream can be 3 seconds behind live and still take 5 seconds to start. Rebuffering is how often playback freezes, and it tends to rise when you push latency down, so watch both.

Before measuring, know what to expect. These are the reference figures on XtreamCast, with the point at which we would start looking for a problem:

DeliveryExpected delayLook into it if
Standard HLSAbout 30 s, a margin the player keeps on purpose to absorb network dropsConsistently above 45 s, or growing during the stream
LL-HLS add-onAbout 3 sConsistently above 5 s
WebRTC playback add-onUp to 0.3 s, never guaranteedConsistently above 1 s

The last column is our own rule of thumb, based on what we see when something in the chain is misconfigured.

The clock test: a real number in five minutes

This is the method we use with customers before an important event. It needs nothing you do not already have:

  1. Open a stopwatch or a clock that shows tenths or hundredths of a second, on a phone or a second monitor.
  2. Point the camera at it and go live as you normally would, with your usual encoder settings.
  3. Open the stream on the device you want to test, ideally a phone on mobile data since that is what many viewers use, and hold it next to the clock.
  4. Take a photo that shows both: the real clock and the clock inside the stream.
  5. Subtract. The difference is your glass-to-glass latency.

Repeat it three or four times, at the start and again after half an hour: some players drift further from live as the stream goes on, especially after a network hiccup. Write the numbers down with the date, the device and the network. That log is what lets you compare when you change something.

A more precise version without a camera

If you stream from a computer, you can leave the camera out and use the computer's own clock on both ends. Save these two lines as clock.html and open the file in a browser window:

<body style="margin:0;background:#000;color:#fff;font:72px monospace"></body>
<script>setInterval(() => document.body.textContent = new Date().toISOString().slice(11, 23), 10)</script>

In OBS, add a Window Capture of that browser window to a scene (on macOS, a screen capture set to that window) and go live. Then open your stream's player in another window on the same screen and take a screenshot that shows the clock window and the player side by side. Both clocks come from the same computer, so the difference is the delay of the whole chain: encoder, upload, server, delivery and player. The only part it leaves out is the camera itself, which adds a few frames.

How to check stream delay on YouTube, Twitch and OBS

YouTube

Right-click the player during a live stream and open Stats for nerds. The live latency line shows YouTube's estimate of how far behind live you are watching. It is a quick sanity check, but YouTube calculates it from its own side, so it may leave out your encoder and your upload. The clock test is still the reference.

Twitch

Click the gear icon on the player, open Advanced and turn on Video Stats. Latency To Broadcaster shows Twitch's estimate in seconds. If it reads far higher than you expect, check the latency mode in your Creator Dashboard (Settings, Stream) before you touch anything else.

OBS

OBS cannot see what viewers see, so it cannot tell you the delay. What it can tell you is whether the encoder is the problem: its Stats panel shows frames dropped because of the network, frames skipped because of encoding lag and CPU usage. Dropped frames point to your upload; skipped frames point to your computer. And check Settings, Advanced, Stream Delay: if it is enabled, OBS adds that delay on purpose.

How to calculate stream delay before you measure it

You can estimate latency by adding up the stages: encoder, plus upload, plus segment or part duration, plus the player's hold-back. The hold-back, the margin the player keeps behind the live edge, is almost always the largest term. Three common setups:

SetupWhere the time goesRough total
Regular HLS with 6-second segmentsThe player starts three segments back (18 s), plus encoding, upload and producing each segment20 to 30 s
LL-HLS with parts of a third of a secondA hold-back of about 1 s, plus encoding, upload and network2 to 4 s
WebRTCNo segments: a small jitter buffer plus encoding and networkUnder a second

That is why the protocol matters more than any encoder tweak, and why our guide on how to reduce stream delay starts with delivery, not with OBS.

Tools for developers: player APIs and browser tools

If you build your own player page, you can measure from code and log the result for every viewer:

  • hls.js exposes hls.latency, the distance in seconds between the playhead and the live edge of the playlist. If the playlist carries EXT-X-PROGRAM-DATE-TIME tags and the encoder's clock is synchronized, hls.playingDate gives the wall-clock time of the frame on screen, and comparing it with the current time gets you close to glass-to-glass.
  • WebRTC statistics come from getStats() on the connection, and Chrome shows all of them at chrome://webrtc-internals: round trip time, jitter, packets lost and the jitter buffer delay.
  • Browser developer tools. The Network tab shows every playlist and segment request. If segments arrive every 6 seconds, you are not on low latency delivery, whatever the settings say. With LL-HLS you should see small parts arriving once a second or faster.

Keep in mind what these measure. Player APIs start counting at the server's playlist, so they leave out the encoder and the upload. They are perfect for watching a trend across thousands of viewers, but the clock test is what gives you the full number.

Finding where the delay comes from

When the number is higher than it should be, work down the chain in this order:

  1. Encoder. Dropped or skipped frames in OBS, a CPU near its limit, or a keyframe interval above 4 seconds. On XtreamCast, the panel's ingest diagnostics show the keyframe interval, frame rate and bitrate that actually arrive, refreshed every 10 seconds.
  2. Upload. A connection that cannot sustain the bitrate shows up as frames dropped because of the network. With SRT, a latency value too small for the line shows up as lost packets and artifacts; our SRT server page explains how ingest works.
  3. Packaging and delivery. Open the playlist: check the segment length, whether there are parts and whether a CDN is caching playlists for too long.
  4. Player. A large buffer, a player without LL-HLS support or a viewer who paused. Compare two players on the same network: if one is far behind, the problem is the player.
Common causeWhat it addsFix
OBS Stream Delay left onExactly the seconds configuredTurn it off in Settings, Advanced
Keyframe interval of 4 to 10 secondsLonger segments and slower startup2 seconds
x264 medium or slow preset with look-aheadAround 1 to 2 sveryfast and the zerolatency tune
Regular HLS with 6 to 10-second segmentsAbout three segments of waitingLL-HLS, or shorter segments on your own server
A CDN caching playlists too longSeveral secondsShort playlist caching, query string in the cache key

If your problem is freezing rather than delay, our list of common live streaming problems covers the usual causes.

Monitoring latency over time

One measurement before an event is good. A habit is better. For recurring streams we suggest:

  • A clock test at every rehearsal, logged with date, device and network.
  • Thresholds based on your own target rather than a generic number: a warning at 50% above it and an alarm at double.
  • Player-side analytics if your audience is large. Services such as Mux Data, NPAW or Conviva collect startup time, rebuffering and errors from every viewer; check that they report live latency for your player before you sign up.
  • An eye on the ingest during the event. If the bitrate or keyframe interval changes mid-stream, latency and stability change with it. On XtreamCast the panel shows both, next to the channel's statistics and metrics.

Measuring on XtreamCast

Measure on your real setup before the event: same encoder, same network, same viewer devices. The free plan is enough to measure your baseline with standard HLS and RTMP or SRT ingest. LL-HLS (about 3 seconds, USD 20/month) and WebRTC playback (up to 0.3 seconds, USD 20/month) are per-channel add-ons on paid video plans, and the clock test is how you confirm what you get on your own networks. We explain each one in our guides to low latency HLS and WebRTC streaming, and compare them on the low-latency streaming page.

If your numbers are far from these, our support team is available 24/7 on WhatsApp, email and tickets to go through the ingest diagnostics with you.

Measure your baseline, then decide

The free plan includes RTMP and SRT ingest and HLS delivery, enough to run the clock test on your own setup before you add LL-HLS or WebRTC.