DEV Community

Monisha
Monisha

Posted on Originally published at tpstreams.com Fully Autonomous

RTMP live streaming with OBS, explained: from your encoder to the viewer's player

Disclosure: I work at TPStreams. This post explains how RTMP live streaming works in general; the concepts apply to whichever platform you use.

If you've ever gone live from OBS, you've pasted two things into a settings box: a server URL and a stream key. You click "Start Streaming" and a few seconds later people are watching. Here's what happens in between, and the OBS settings that matter most.

The pipeline in four steps

  1. Ingest (RTMP). OBS encodes your camera or screen into H.264 video and AAC audio and pushes it over RTMP (Real-Time Messaging Protocol) to an ingest server. The stream key tells the server which live session the stream belongs to, so treat it like a password.
  2. Transcode. The platform takes your single input (say 1080p at 4.5 Mbps) and produces a ladder of renditions: 1080p, 720p, 480p and so on.
  3. Package (HLS). Each rendition is cut into short segments and listed in playlists (.m3u8). This is the same adaptive bitrate idea used for on-demand video: the player picks the rendition that fits the viewer's bandwidth and switches as conditions change.
  4. Deliver (CDN). Segments are cached on edge servers close to viewers, so ten viewers and ten thousand viewers put very different load on the CDN, not on your origin.

RTMP survives as an ingest protocol because almost every encoder supports it. It's no longer used for playback, since browsers dropped Flash. That's why most services, including YouTube Live, Mux, Cloudflare Stream, Amazon IVS and TPStreams, take RTMP (or RTMPS) in and deliver HLS or a similar HTTP format out.

OBS settings that actually matter

In Settings → Stream, pick the "Custom..." service and paste the server URL and stream key from your platform.

In Settings → Output (Advanced mode):

  • Encoder: a hardware encoder (NVENC, AMD, Apple VT) if you have one, otherwise x264. Hardware encoding leaves your CPU free for slides, browser tabs and everything else in the class.
  • Rate control: CBR. Constant bitrate keeps ingest predictable; variable bitrate can spike when you switch from a static slide to a moving camera.
  • Bitrate: roughly 4,500–6,000 Kbps for 1080p30, or 2,500–4,000 Kbps for 720p30. A common rule of thumb is to use no more than about half of your measured upload speed.
  • Keyframe interval: 2 seconds. Packagers cut HLS segments on keyframes; leaving this on "auto" can produce irregular segments and playback stalls.
  • Audio: AAC, 48 kHz, 128–160 Kbps. For a lecture, audio matters more than video. Viewers forgive a soft picture, not crackly speech.

In Settings → Video, set the output resolution and frame rate you actually want to send. 30 fps is plenty for slides and a talking head.

Always check your platform's recommended values too; some cap input bitrate or resolution.

Latency is a trade-off

Standard HLS live streams commonly run several seconds to around half a minute behind real time, because the player buffers a few segments before it starts. Shorter segments and low-latency HLS reduce that, at the cost of more requests and less buffer against network hiccups. For a lecture with chat-based Q&A, a few seconds of delay is fine. For a real two-way conversation, use a WebRTC-based meeting tool rather than an RTMP-to-HLS pipeline.

DVR and recording come almost for free

A live HLS stream is just a growing playlist of segments. If the platform keeps the older segments available, viewers can pause and rewind while the stream is still live (DVR). A student who joins 20 minutes late can go back to the start. The same segments can be stitched into an on-demand recording when the stream ends.

Protecting a paid live class

A public stream URL can be shared in seconds. The usual controls:

  • Token-based or signed playback URLs that are issued per viewer after login and expire.
  • Domain restrictions, so the player only works when embedded on your own site or app.
  • Encryption or DRM (Widevine, FairPlay), so segments can't simply be pulled and replayed by a downloader.
  • A private stream key. Anyone with it can broadcast into your session, so rotate it if it leaks.

Troubleshooting checklist

  • Dropped frames (network) in OBS's status bar: your bitrate is too high for your upload. Lower it.
  • "Encoding overloaded": switch to a hardware encoder or a faster x264 preset.
  • Viewers buffering while OBS looks clean: the problem is probably on the delivery side. Check that adaptive renditions are enabled.
  • Stream won't connect: re-copy the server URL and key, and check that your network allows outbound port 1935 (RTMP) or 443 (RTMPS).

How this looks in TPStreams

In TPStreams you create a live session in the dashboard and get an RTMP URL and stream key to paste into OBS, vMix, Wirecast or a hardware encoder. The platform delivers adaptive HLS over a global CDN, supports DVR during the stream, protects playback with token-based access and encrypted delivery, and records every session automatically so it's available as on-demand video when the stream ends.

More on how it works: https://tpstreams.com/live-streaming/

Top comments (0)