Skip to main content

Streaming from OBS

Stream from OBS when you want scenes, overlays or several cameras. Live Stream takes OBS 30 or later, and any other encoder that streams over WHIP. You still go live from the studio: OBS sends the picture, and the studio decides when viewers see it.

Connect OBS​

  1. Open the studio of the stream (Live Stream → Studio, then Go live beside the stream) and choose Stream from OBS. With the camera already on, it is under More.
  2. The studio shows the steps, with "Waiting for OBS…":
    1. In OBS, open Settings → Stream and choose WHIP as the service.
    2. Copy Server from the studio into the Server field of OBS.
    3. Copy Bearer token from the studio into the Bearer Token field of OBS. Show reveals it, Copy copies it.
    4. In the same window, set Total Layers to 3 if your OBS has it (OBS 32.1 or newer).
    5. Set the output of OBS as the studio says (below), then press Start Streaming in OBS.
  3. Once the picture from OBS arrives, the studio says OBS is connected and shows the picture, with what arrives: its size, frame rate and bitrate. Only you see it so far.
  4. Press Go live. Viewers see the whole picture from OBS.

The studio with OBS connected: the picture from OBS previewed, what arrives from it, the steps, the server address and the bearer token

What to set OBS to​

Layers​

With Total Layers at 3 (Settings → Stream, OBS 32.1 and newer), OBS sends the full picture and two smaller copies of it, at once. Each viewer gets the largest their screen and connection take, and a viewer whose connection slows down steps down to a smaller copy instead of stopping to wait. It needs an encoder for each copy, and more upload from your computer than one picture: OBS gives the full picture the bitrate you set and the copies two thirds and one third of it, so 4,500 kbps takes about 9 Mbit/s of upload in all. If your upload cannot carry that, viewers see the picture freeze: set a lower bitrate, or 2 layers.

Without it, OBS sends one picture, the same to every viewer, so choose a size every connection can take.

Size and bitrate​

The studio gives this advice, word for word:

In Settings → Video, set Output (Scaled) Resolution to 1920×1080 and 30 FPS. Without layers, 1280×720 lets viewers on slow connections keep up.

In Settings → Output, choose the Advanced output mode. Under Streaming, keep the video encoder Simple mode had, and set the bitrate to about 4,500 kbps (2,500 kbps without layers), Keyframe Interval to 1 s and Max B-frames to 0. Viewers coming in then get the picture within a second, and it plays smoothly in their browsers. Then press Start Streaming in OBS.

These settings are a starting point. Try them on your own stream and connection: watch it from another device, and change the bitrate, Total Layers or the preset until it plays smoothly.

If OBS sends a bigger picture than the stream takes, the studio says so and does not go live until it is changed. For example:

OBS sends 2560×1440, more than the 1080p a stream takes. In OBS, set Settings → Video → Output (Scaled) Resolution to 1920×1080.

Keyframes and B-frames: the Advanced output mode​

Two settings decide how soon viewers see the picture and how smoothly it plays, and only the Advanced output mode of OBS has them (Settings → Output → Output Mode, then the Streaming tab):

  • Keyframe Interval: 1 s. A viewer sees the picture from the next keyframe on, when they come in and when they come back to the page from another tab. OBS sends a keyframe only at its interval, and the Simple output mode leaves it on auto, about one every 8 seconds, so viewers wait up to 8 seconds. At 1 s they wait a second at most.
  • Max B-frames: 0. Browsers cannot play B-frames and skip them, so a picture with B-frames stutters. The Simple output mode sends none, but the Advanced mode has a setting of its own, which some encoders start at 2.

The Advanced mode also has its own Video Encoder. Keep the one the Simple mode had, a hardware encoder of your graphics card where there is one, and the same preset. Leave the rest as it is.

The studio checks both while OBS sends:

OBS sends a keyframe every 8 seconds, so viewers wait up to that long for the picture as they come in and when they come back to the page. In OBS, choose the Advanced output mode in Settings → Output and set Keyframe Interval to 1 s under Streaming.

OBS sends 22 frames a second, fewer than it should, and viewers see the picture stutter. In OBS, set Max B-frames to 0 under Settings → Output → Streaming, in the Advanced output mode, since browsers skip B-frames. If it is 0 already, the encoder cannot keep up: choose a faster preset or fewer Total Layers.

Neither stops you going live.

Try them on your stream​

These numbers are a starting point. What suits a stream depends on what it shows, on the computer that sends it and on its connection, so try them before you go live:

  1. Make a stream for trying, on a page nobody else knows, start streaming in OBS and press Go live in its studio. Viewers see the picture only once it is live.
  2. Open the page of the stream on another device, on another network if you can, and watch it for a few minutes, with the kind of picture you will stream.
  3. Keep View → Stats open in OBS. It shows frames skipped by the encoder and frames dropped on the way out.

Then change one thing at a time:

  • The picture freezes and catches up again: your upload cannot carry what OBS sends. Lower the bitrate, or set Total Layers to 2.
  • The picture stutters, and Stats shows frames skipped due to encoding lag: the encoder cannot keep up. Choose a faster preset, or fewer layers. Another program using the graphics card, such as a remote desktop, can take its share too.
  • Detail pulses once a second on a busy picture: each keyframe takes a large share of the bits. Raise the bitrate if your upload carries it, or set Keyframe Interval to 2 s, which makes viewers wait up to 2 seconds for the picture.
  • Everything plays smoothly: keep it, or try a higher bitrate for a sharper picture while it still does.

The bearer token​

  • Only the hosts of the stream see it, in the studio.
  • New key makes a new one. OBS stops streaming until it has the new one, so do this if the token was seen by someone it should not have been.
  • Each stream has one, the same every time you go live with it, until you make a new one.

Back to the camera​

Use the camera instead leaves OBS and goes back to the preview of the camera.

Going live on its own​

For a stream that runs by itself, such as a demo sent from a computer that is always on, open the stream in Live Stream → Studio → Streams and turn on Go live when OBS connects. Then:

  • The stream goes live as soon as OBS starts streaming with its token, with nobody in the studio.
  • If OBS stops for a while, the stream stays live while anyone watches. With nobody watching for five minutes it ends, and it goes live again as soon as OBS is back.
  • It stays live for as long as OBS sends, for days too.
  • When you end it in the studio, it stays ended, even if OBS tries again. Choose Stream from OBS in its studio to let OBS take it live again.

Take the token from the studio once, as above. A change of the setting reaches the stream the next time a host opens it, so open its studio after you change it.

When something is wrong​

  • "Nothing has come from OBS yet. Start streaming there first": press Start Streaming in OBS, and check the server and the token.
  • The studio stays on "Waiting for OBS…": check that the service in OBS is WHIP, and that the server and the token were copied whole.
  • OBS says it could not access the stream key: OBS says this whatever the cloud answered. Check that the token was copied whole and is the one the studio shows now.
  • OBS cannot connect after the stream ended: an ended stream keeps OBS out. Choose Stream from OBS in its studio again, then start streaming in OBS and go live.
  • Viewers wait several seconds for the picture, as they come in or come back to the page: set Keyframe Interval to 1 s in the Advanced output mode (above).
  • The picture stutters for viewers: set Max B-frames to 0 in the Advanced output mode (above). If it is 0 already, OBS cannot encode fast enough: choose a faster preset, or fewer Total Layers. View → Stats in OBS shows frames skipped by the encoder and frames dropped on the way out.
  • The picture freezes and catches up again: your upload cannot carry what OBS sends. Lower the bitrate, keeping in mind that three layers take about twice it in all.