RTMP vs. HTTP Live Streaming (HLS): when to use each

12/21/2023

In a scenario in which, according to Zero Gravity data, 80% of the followers of a brand prefer to watch live stream content than read their blog, and also considering that this number rises to 82% when we compare streaming live and a post on social networks, there is no doubt that companies should consider this way of streaming relevant information to the public.

Under this premise, it is essential to learn one of the most important aspects of live streaming: the protocols, with HLS and RTMP being two of the most common.

What are transmission protocols?

Live streaming protocols are framed within the context of the internet protocol family, which is defined as a set of computer rules that can transmit data between computers.

The development of broadband and the internet made it possible to view live streaming without downloading files, which necessarily forced the birth of live transmission protocols and their corresponding standardization.

What are RTMP and HLS?

To understand what RTMP and HLS are, we must first specify that they both consist of ingest protocols, which refer to the transmission of audio and video data from a live streaming source (for example, an encoder) to a processing entity (for example, a content delivery network -CDN-).

RTMP

The Real-Time Messaging Protocol or RTMP is a protocol created by Adobe to communicate the Flash player and Adobe Air. It transports audiovisual content as data between the encoder and streaming platform. Today it is mostly used for CDNs.

  • It uses the Transmission Control Protocol or TCP, one of the basic internet protocols, ensuring that the information transferred arrives correctly.
  • In principle, it does not adapt the transmission quality to the user's resources (adaptive bitrate); this depends on the platform used.
  • Its playback requires Adobe Flash for most internet browsers.

HLS

HTTP Live Streaming or HLS consists of a protocol that transmits audio and video over HTTP and whose main characteristic is that it supports adaptive bitrate streaming. It was developed by Apple and works for both live streaming and VOD.

  • The quality of the image played is adapted according to the broadband resources of each user.
  • The video content can be delivered from an HTTP server (Hypertext Transfer Protocol), which defines the entire internet's basic rules (World Wide Web or WWW).
  • Video encoding is done in segments (video chunks), usually every 10 seconds. An index file is created, which contains each segment's information, from where the player will download the content in parts.
  • Content can be encrypted to protect copyright.

RTMP vs. HLS: which to choose?

Given the complexity of these protocols, it is suggested to perform streaming tests before choosing since unforeseen events may arise along the way that must be resolved in advance. Additionally, factors such as budget, playback conditions, and the content's nature are also essential.

RTMP has very low latency when using TCP; however, it requires Adobe Flash in browsers, which is gradually becoming obsolete. On the other hand, there is some intrinsic latency in the HLS; yet, this protocol has been the most widely used (and continues to increase) since it works natively in browsers, smart TVs, and Android and Apple devices; plus, it works with adaptive bitrate.

Mediastream's Content Delivery Network solution supports both protocols. RTMP is the most widely used protocol for ingesting and HLS for playback. The latter is the most recommended by the company; its delivery is segmented. It is multi-quality adaptive and supports HTML5 ensuring fast transmissions with the best quality to more than a million users.

Recomendados