What is RTMP? – Real-Time Messaging Protocol Explained

What is RTMP?

Watch a video on YouTube or a live-stream on Twitch, and you’ll be amazed at how seamless and “real-time” everything is. Things have certainly improved from the sluggish video streaming of just a decade ago.

Well, you can thank RTMP for that. It’s a widely used protocol that enables live video streaming—and so much more—on the Internet.

In this article, we’ll discuss what exactly RTMP is, the way it works, and how it impacts video streaming now, as well as how it will do so in the future.

What is RTMP, and What Does RTMP Stand For?

RTMP, or Real-Time Messaging Protocol, is an efficient way to transmit large chunks of audio, video, and data from a server to the Internet via an encoder. Most live video streaming relies on RTMP to deliver smooth, real-time playback.

RTMP Overview

Macromedia first defined the RTMP specification as a way to stream data from a server to Flash players.

Adobe then acquired Macromedia, and has since made the RTMP source code available to the general public. This move led to broader adoption of the RTMP specification, making it the standard for transporting video over the Internet.

Today, RTMP is mainly used as a way to stream live video so the playback is as smooth as possible. This protocol also gives dynamic playback control, allowing a viewer to skip ahead to any part of a video.

Being open-source, RTMP has also evolved into several variations including RTMPS, RTMPE and RTMPT, and others We will give a brief summary of each, but the focus will be on RTMP.

RTMPS simply means that the protocol allows data streaming using a Secure Sockets Layer (SSL) connection on top of RTMP, giving users an added layer of security.

RTMPE (the E stands for encrypted) is an extension of RTMP and provides security by encrypting steam packets prior to transmission.

RTMPT, which is a way to bypass firewalls by placing regular RTMP packets inside HTTP requests.

Now let’s elaborate more about the functionalities of RTMP.

RTMP Setup

For the RTMP protocol to work, it requires three components: an encoder, a content distribution network, and a connection between the two.
  • Encoder: This is the source of the video itself. It can be the platform where you created the live video or the server where the video file is residing.
  • Content Distribution Network: The Content Distribution Network is the delivery platform where the video is distributed over the Internet and ultimately ends up in front of your viewers. The goal of the delivery platform is to stream video-on-demand as smoothly as possible with minimal latency and buffering. The most popular delivery platforms today include Facebook and YouTube.
  • RTMP Values: This is the connection that allows the encoder to communicate with the content distribution network. The value is like a unique address that identifies the former to the latter. It is made up of two parts: the server URL and the stream ID.

How it Works

The secret to how RTMP achieves low latency streaming is by breaking the video up into smaller parts called packets. It allows them to be transmitted more efficiently over the network, reducing overhead and achieving smooth playback.

RTMP involves three distinct steps:

  1. First, you need to determine the RTMP Values. This is the unique address your encoder needs to be able to locate the server.
  2. Once the encoder finds the server, a handshake needs to be established. This is the initial “meeting” where vital pieces of information exchange between encoder and server. Once both sides confirm these data with each other, the handshake is complete.
  3. The last step is to establish a connection. This is done by sending messages using the Action Message Format (AMF). The encoder initiates this by requesting a connection, to which the server will accept.

With a connection set up, the encoder can now start streaming RTMP video to the server.

RTMP Requirements

For RTMP to work efficiently, it needs a large number of local servers in the content distribution network. Data is distributed from the central source to various data centers around the world.

While RTMP has proven to be a dominant protocol for live streaming, it has its shortcomings. In many situations, routing of data over the internet from one end to another isn’t always a smooth process. With varying factors such as high usage and network congestion, transporting data across a given path may bring about some level of fluctuation. Since RTMP continuously streams data over the public internet, the effects of this could result in minor to huge latency issues, jitter, data or packet loss. In other words, the transmission of data may be lost or disrupted, and there may be delay in the network communication.

One of the guaranteed ways to alleviate the above issues is the use of a private network infrastructure. 

Agora improves upon this RTMP framework with its proprietary Software Defined Real-Time Network (SD-RTN™) architecture.

First, Agora SD-RTN uses an efficient algorithm to help reduce latency associated with a vast distribution network. It leads to close to real-time playback of streaming video through SD-RTN.

Second, SD-RTN has a high level of availability and stability. Users will experience zero connection errors or failed video streaming 99.98% of the time. SD-RTN does this with a dynamic network logic that always finds the best path through the network regardless of conditions.

Lastly, SD-RTN also offers bi-directional connections that give an authentic real-time messaging experience during interactive streaming. It allows users in the network to communicate with each other much more efficiently. It’s something that regular content distribution networks—which are unidirectional—cannot do.

RTMP is the backbone that powers live video streaming in today’s world. Agora’s SD-RTN architecture builds upon that foundation with a reliable, highly scalable, and intelligent network.

Get started for free today or give us a call at 408-879-5885 if you’d like to know more about how to integrate this and other Agora solutions to power your web, mobile, and desktop applications.


Add high-quality voice, video and streaming to any app with ease.