Which is better for live streaming, RTMP vs HLS vs WebRTC?

It’s hard to say which one is better, as we’re not comparing apples. Let’s break it up to the strengths and weaknesses of each method.

RTMP used to be the de facto standard for live streaming. Many CDNs offer delivery that scales to the masses. RTMP, however, does not take into consideration that broadcaster and viewers might have internet connections that aren’t always up to the task of transferring the stream at full speed. Smartphones and web browsers are also unable to play back RTMP natively; Browsers used to depend on a flash plugin for playback, which has been phased out over the last couple of years.

HLS was created for using existing HTTP CDNs for delivering live streams. It scales great, but latency can suffer in many implementations. Bitrate can adapt depending on the viewers needs. Most devices can play HLS natively, or through a javascript player. This is probably the most cost-effective way of delivering video.

WebRTC is more focused for one-to-one streaming. Bitrate is adaptable, but not many CDNs support edge delivery over WebRTC – those that do cost quite a bit more than other solutions. WebRTC can be played back in most browsers and smartphones today, using javascript players. Open source solutions for native playback and broadcasting are also available.