Technology

RTMP vs HLS vs WebRTC: What Each Protocol Does and When to Use It

They are not three rivals for the same job. RTMP gets your video to the server, HLS takes it to any screen at scale and WebRTC is for the moments when a few seconds of delay ruin the experience.

Three protocols, three different jobs

Most of the confusion around these three comes from comparing them as if they competed for the same job. They do not. Every live stream has two legs. The first, contribution, goes from your encoder to a server. The second, delivery, goes from that server to your viewers. RTMP lives on the first leg. HLS and WebRTC are two ways of covering the second.

A typical professional setup looks like this: OBS or vMix sends RTMP (or SRT) to a streaming server, the server repackages the video as HLS for everyone and, when a group needs to interact in real time, also as WebRTC. Once you see the two legs, the choice gets much easier.

ProtocolMain jobTypical latencyPlays in a browser
RTMPEncoder to serverSmall on its own legNo, not since Flash ended
HLSServer to any screen, at scale10 to 30 s; LL-HLS about 2 to 5 sYes
WebRTCReal-time delivery to interactive audiencesUnder 1 sYes

RTMP: still the standard way in

RTMP (Real-Time Messaging Protocol) was created by Macromedia around 2002 to stream to Flash Player, and Adobe later published its specification. Flash Player reached its end of life on December 31, 2020, so no browser plays RTMP any more. The protocol survived anyway as the default way to send a live stream to a server, because every encoder speaks it and every platform accepts it: a URL, a stream key and you are live.

It runs over TCP, usually on port 1935, or encrypted as RTMPS over TLS. Classic RTMP carries H.264 video and AAC audio; the newer Enhanced RTMP extension adds HEVC and AV1, which some platforms already accept. Its weak spot is packet loss: TCP stalls and slows down when packets go missing, which is why SRT has taken over on unstable or long-distance links. We cover that trade-off in SRT vs RTMP.

On XtreamCast, the RTMP server receives H.264 and AAC by RTMP, RTMPS or SRT (and WebRTC by WHIP on paid plans), and the panel shows ingest diagnostics every 10 seconds: protocol, codecs, keyframe interval, frame rate and bitrate.

HLS: how video reaches every screen

HLS (HTTP Live Streaming) was introduced by Apple in 2009 and is documented in RFC 8216, an informational RFC from 2017 that Apple keeps extending. The server cuts the video into short segments, usually 2 to 6 seconds each, and lists them in a playlist with the .m3u8 extension. The player downloads the playlist and then the segments, one after another, over plain HTTPS. Our guide on what an M3U8 file is goes into the playlist format.

Because segments are ordinary files served over HTTP, any CDN can cache them, and that is why HLS scales to huge audiences. It also plays almost everywhere. Safari has always played it natively, Chrome and Edge on desktop do so since versions 141 and 142 (late 2025), other browsers use a JavaScript player such as hls.js, and smart TVs, set-top boxes and IPTV apps support it out of the box.

The price is latency. The player wants a few segments in hand before it starts, so standard HLS usually runs 10 to 30 seconds behind real time. On XtreamCast the player deliberately keeps about 30 seconds of margin, which is what lets it ride out a viewer's Wi-Fi drop without buffering. When that delay is a problem, Low-Latency HLS splits segments into small parts and gets to about 3 seconds: on XtreamCast, LL-HLS is a per-channel add-on for USD 20/month, activated by our team with no change to your encoder.

HLS can also offer several qualities and let the player switch between them according to each viewer's connection, but only if the server produces those qualities. On XtreamCast that is the job of XtreamTranscoder, which keeps your original and adds 720p, 480p and 240p. Without it, viewers get the single quality you send.

WebRTC: when seconds matter

WebRTC was built for video calls in the browser, and since 2021 it has been both a W3C Recommendation and a set of IETF RFCs. It sends media over UDP, always encrypted, and keeps delay well under a second. Every modern browser supports it, with Opus audio and H.264 or VP8 video as the common ground.

For broadcasting, the catch is scale. Each viewer holds a live connection to a media server, which forwards the stream to them individually and reacts to their network conditions. That costs much more per viewer than serving HLS files from a cache, and ordinary HTTP CDNs cannot help. WebRTC is the right tool when a few seconds of delay break the experience: live auctions where bidders must see the lot at the same moment, Q&A sessions where the host answers the audience live, remote guests and betting-style interaction.

On XtreamCast, WebRTC playback is a per-channel add-on for USD 20/month, with latency of up to 0.3 s on a good connection (a ceiling, not a guarantee). Know its limits before you plan around it: it plays one quality, without adaptive bitrate; it does not fall back to HLS on its own; and it is meant for interactive groups, while large audiences watch on HLS. Ingest stays the same (RTMP, RTMPS or SRT, or WHIP on paid plans), and there is no WHEP endpoint; we explain both protocols in our guide to WHIP and WHEP.

RTMP vs HLS vs WebRTC compared

FeatureRTMPHLSWebRTC
Main jobIngestDelivery at scaleReal-time delivery
TransportTCPHTTP over TCP, or QUIC with HTTP/3UDP
Typical latencySmall on its own leg10 to 30 s; LL-HLS about 2 to 5 sUnder 1 s
Browser playbackNoYesYes
Smart TVs and set-top boxesNoYes, the usual formatRarely
CDN cachingNoYes, any HTTP CDNNo, it needs WebRTC servers
Adaptive bitrateNoYes, with several renditionsDepends on the server
Audience sizeNot applicableVery large with a CDNInteractive groups

Resolution is missing from the table on purpose. None of the three caps quality: YouTube takes 4K over RTMP, and HLS and WebRTC can carry high resolutions too. The real limits come from encoders, players and bandwidth, not from the protocols themselves.

Where DASH fits

MPEG-DASH does the same job as HLS: segments plus a manifest, delivered over HTTP. It is an international standard (ISO/IEC 23009-1, first published in 2012) and it does not care which codec you use, but Apple devices have always favored HLS, so services that want every screen often package both. CMAF, a segment format that both can share, exists to avoid storing everything twice; see what CMAF is. XtreamCast delivers HLS, not DASH, which already covers browsers, phones, smart TVs and IPTV apps without a second format.

Which protocol for which job

Church services, corporate events and lectures

RTMP or SRT in, HLS out. A delay of 20 or 30 seconds does not matter to someone following a service or a town hall, and HLS gives them the most stable picture on any device. If students or employees need to talk back, a video-call tool is the honest answer: a streaming server is built for one-to-many.

24/7 channels and IPTV distribution

HLS. The M3U8 URL works in web players, apps, smart TVs and IPTV systems, and headends that prefer SRT can take the channel's SRT output instead.

Shows driven by live chat

LL-HLS. At about 3 seconds, the host reads a comment and answers while the viewer still remembers writing it, and HLS keeps its scale.

Auctions, live betting and remote guests

WebRTC for the people who interact, HLS for everyone who only watches. Running both on the same channel is common: bidders get real time, the wider audience gets stability.

How this maps to XtreamCast

  • Ingest: RTMP, RTMPS or SRT on every plan, with H.264 video and AAC audio, and WHIP (WebRTC) on paid plans.
  • Delivery: HLS through Player Advance™, with about 30 seconds of margin by design.
  • Lower latency: the LL-HLS add-on at about 3 s, or WebRTC playback at up to 0.3 s for interactive groups.
  • Other outputs: SRT output for headends, and Restream to up to 30 RTMP or RTMPS destinations on paid video plans.
  • Not available: DASH and WHEP playback.

If you want the full picture of the server side, start with our streaming server page. It shows how a single channel feeds your website player, your apps and social platforms from one encoder.

RTMP or SRT in, HLS and WebRTC out

Send RTMP or SRT from your encoder and deliver HLS to any screen. Add LL-HLS or WebRTC playback to a channel when your audience needs to keep up in real time.