RTMP Streaming: The Real-Time Messaging Protocol Explained (Update)

November 10, 2021 by
 

In the early days of streaming, the Real-Time Messaging Protocol (RTMP) was the de facto standard for transporting video over the internet (or in laymen’s terms, streaming). RTMP is a TCP-based protocol designed to maintain persistent, low-latency connections — and by extension, smooth streaming experiences.

The protocol started out as the secret sauce behind live and on-demand streaming with Adobe Flash Player. Because this popular Flash plugin powered 98% of internet browsers in its heyday, RTMP was used ubiquitously.

The majority of encoders today can transmit RTMP, and most media servers can receive it. Even big social media players like Facebook, YouTube, and Twitch accept it. However, RTMP streams run into compatibility issues when it comes to playback on popular browsers and devices.

In this article, we’ll look at the RTMP specification, the history behind RTMP streaming, how to start streaming with an RTMP encoder, and alternative protocols to consider.

 

Table of Contents

   

What Is RTMP?

The RTMP specification is a streaming protocol initially designed for the transmission of audio, video, and other data between a dedicated streaming server and the Adobe Flash Player. While once proprietary, RTMP is now an open specification.

According to Adobe:

“Adobe’s Real Time Messaging Protocol (RTMP) provides a bidirectional message multiplex service over a reliable stream transport, such as TCP [RFC0793], intended to carry parallel streams of video, audio, and data messages, with associated timing information, between a pair of communicating peers.”

 

RTMP Streaming: A Snapshot 

  • Audio Codecs: AAC, AAC-LC, HE-AAC+ v1 & v2, MP3, Speex
  • Video Codecs: H.264, VP8, VP6, Sorenson Spark®, Screen Video v1 & v2
  • Playback Compatibility: Not widely supported
    • Limited to Flash Player (which has been discontinued by Adobe), Adobe AIR, RTMP-compatible players
    • No longer accepted by iOS, Android, most browsers, and most embeddable players
  • Benefits: Low latency and minimal buffering
  • Drawbacks: No longer being updated or supported
  • Latency: 5 seconds
  • Variant Formats: RTMPT (tunneled through HTTP), RTMPE (encrypted), RTMPTE (tunneled and encrypted), RTMPS (encrypted over SSL), RTMFP (layered over UDP instead of TCP)
 

How Does RTMP Streaming Work?

Macromedia (which is today Adobe Systems) developed the RTMP specification for high-performance transmission of audio and video data. RTMP maintains a constant connection between the player client and server, allowing the protocol to act as a pipe and rapidly move video data through to the viewer.

Because RTMP sits on top of the Transmission Control Protocol (TCP), it uses a three-way handshake when transporting data. The initiator (client) asks the accepter (server) to start a connection; the accepter responds; then the initiator acknowledges the response and maintains a session between either end. For this reason, RTMP is quite reliable.

 

History of RTMP Streaming

Flash Player and RTMP were the dominant delivery mechanisms for live streaming up until the early 2010s. When used together, these technologies support lightning-fast video delivery with around five seconds of latency. But HTML5 video streaming, open standards, and adaptive bitrate delivery eventually edged RTMP streaming out when it came to last-mile delivery.

 
Streaming Latency and Interactivity Continuum
 

Why? Although RTMP works well, it historically encountered issues getting past firewalls. And as a stateful protocol, RTMP also requires a dedicated streaming server, making it resource-heavy. The writing on the wall came when Adobe announced the death of Flash — which occurred on December of 2020.

The industry now favors HTTP-based (Hypertext Transfer Protocol) protocols that use plain-old web servers. Using these technologies improves scalability and viewing experience by allowing local servers to cache streaming content. With this move, adaptive bitrate streaming has become more common, allowing broadcasters to optimize content for viewers’ devices and connectivity.

Fewer devices support Flash (and by extension RTMP) than ever before. In Adobe’s own words, content distributors are encouraged “to migrate any existing Flash content to… new open formats.”

Check out our blog on The History of Streaming Media for a more detailed look.

 

So, Is RTMP Dead?

Flash’s end-of-life date was overdue. But the same cannot be said for RTMP. RTMP encoders are still a go-to for many content producers, and a whopping 76.6% of respondents to our 2021 Video Streaming Latency Report currently use it for ingest.

Which streaming formats are you currently using for ingest?

Graph comparing popularity of different ingest streaming protocols, including RTMP, RTSP, and WebRTC.

Many broadcasters overcome limited playback support by initially encoding their live streams with RTMP and then transcoding the content for delivery to a range of players and devices using a streaming server or service.

In other words, RTMP streaming is alive and well for content contribution — just not last-mile delivery.

 

Subscribe and stay up to date

Learn about codecs and protocols, the latest live streaming trends, and much more.

Subscribe
 

Typical RTMP Live Stream Workflow

Content distributors aren’t limited to one streaming protocol from capture to playback. In fact, repackaging a live stream into as many protocols as possible helps ensure broad distribution.   

Because today’s HTML5 players require HTTP-based protocols like HLS, a media server or streaming service can be used to ingest an RTMP stream and transcode it into a more playback-friendly alternative. Whether the RTMP stream is coming from an IP camera, mobile app, or broadcast-grade encoder, Wowza’s live streaming platform makes the conversion and delivery process seamless.

 
Workflow: Streaming Protocols
 

Robert Gibb at StackPath writes:

“A media server is an absolute necessity if you want to leverage RTMP for live streaming. Wowza Streaming Engine, for example, is a widely used streaming software for live and on-demand video that can be installed on any server.”

The most common live streaming workflow out there is RTMP to HLS. Using a combination of RTMP and HLS helps maximize compatibility without pushing latency too high. This architecture also allows broadcasters to use well-supported protocols on either end of the live video delivery chain. Almost all software and hardware encoders support RTMP, and the same can be said for HLS on the playback side.

 
Typical RTMP to HLS workflow where a live stream in encoded into RTMP and repacked into HLS for playback across a range of devices.

How to Set Up an RTMP Stream

To deliver an RTMP stream across the internet, you’ll need to start with an RTMP-compatible camera or encoder. You may be using an IP camera, software encoder, or hardware encoder. We recommend the free OBS software or the Wowza ClearCaster encoding appliance.

Once you’ve chosen the source encoder for your RTMP stream, you’ll want to select a software or service for video transcoding and delivery. We offer the Wowza Streaming Cloud service as an out-of-box solution or the Wowza Streaming Engine software for anyone requiring additional customization. To learn how to connect an RTMP encoder to Wowza’s video platform, check out these resources:

After connecting your RTMP encoder to the Wowza platform, you’ll just have to decide which format(s) you’d like to use for delivery. We’ve included two tutorials below, one showing how to set up an RTMP server for HLS delivery using Wowza Streaming Engine, and another showing how to convert an RTMP stream into WebRTC using Wowza Streaming Cloud.

 

Setting Up an RTMP Server for HLS Delivery

 
 

Converting RTMP to WebRTC Using Wowza Streaming Cloud

 
 

Testing Your RTMP Workflow

To try out your workflow, we offer a Test Player with support for MPEG DASH and HLS on Safari. You’ll notice that the ‘Adobe RTMP’ tab requires the installation of Adobe Flash Player. That’s because native in-browser support is no longer common, and Flash itself is unsupported.

Other options include the free VLC Player or commercial players like THEOPlayer. You’ll find that regardless of which HTML5 player you go with, RTMP playback support no longer exists. In other words, transcoding is essential for an RTMP stream. And by streaming with Wowza, you’re able to select the best formats for multi-device delivery.

 

Considerations When Replacing RTMP

The best protocol for your workflow will depend on your use case. You can check out the pros and cons of each protocol in this blog. But to start, we’d recommend comparing your options based on the considerations below:

  • Scalability
  • Latency
  • Quality of experience (adaptive bitrate enabled, etc.)
  • Use (first-mile contribution vs. last-mile delivery)
  • Playback support
  • Proprietary vs. open source
  • Codec requirements

Transcoding RTMP live streams into adaptive HLS and DASH formats remains a common practice — and might be the best place to start. That said, WebRTC will be better suited for anyone requiring sub-500ms latency, and it can be used for both ingest and egress.

 

RTMP Alternatives for Ingest

While RTMP is still commonplace for first-mile contribution, that’s beginning to change. Industry leaders predict that open-source protocols like Secure Reliable Transport (SRT) and Web Real-Time Communications (WebRTC) could become standard.

 

SRT

SRT is an open-source technology designed for reliable and low-latency streaming over unpredictable public networks. It competes directly with RTMP and RTSP as a first-mile solution but is still being adopted as encoders, decoders, and players add support.

According to Deloitte

“Legacy protocols such as real-time messaging protocol (RTMP), developed over a decade ago to encode video and move it across networks to clients, will likely be displaced by newer solutions such as Secure Reliable Transport (SRT), designed to further decrease latency and meet the demands of live and on-demand streaming.” 

 

WebRTC

WebRTC is a popular ingest protocol in workflows that require sub-second streaming or simple, browser-based publishing. By swapping out an RTMP encoder for a WebRTC-based video source, you’re able to eliminate the need for additional equipment. This makes it easy to seamlessly broadcast a live stream using just a web browser.

Streaming vendors are also working to add WebRTC support to encoding software and hardware through the creation of the WebRTC HTTP Ingest Protocol (WHIP). At Wowza, WebRTC is the underlying technology powering our Real-Time Streaming at Scale feature for Wowza Streaming Cloud, and we’re building WHIP support into our future OBS implementation for the feature.

Check out our video blog, Using WebRTC as an RTMP Alternative, to learn more.

 

RTMP Alternatives for Egress

For last-mile delivery, Apple’s HTTP Live Streaming (HLS) and MPEG-DASH lead the pack, followed by WebRTC.

 

HLS and DASH

HLS is the most common protocol in use for live streaming today, employed by more than 70% of participants in our 2021 Video Streaming Latency Report.

 

Which streaming formats are you currently using for delivery?

A graph comparing the use of different streaming protocols for last-mile delivery and playback, with HLS leading the way, followed by MPEG-DASH and WebRTC.
 

MPEG-DASH is the open-source alternative to HLS and a standard in the industry.

While HTTP-based protocols have gotten heat in the past for injecting far more latency that RTMP, that’s expected to change. Low-latency CMAF for DASH and Low-Latency HLS promise to support low-latency streaming at scale — and thus delivering the best of both worlds.

 

WebRTC

The only real-time alternative to RTMP is WebRTC. The WebRTC framework allows users to communicate directly through their browsers with sub-500ms latency.

Large-scale broadcasting used to be an obstacle when using WebRTC, but Real-Time Streaming at Scale for Wowza Streaming Cloud now ensures sub-second delivery to up to a million viewers. The feature can be used with WebRTC and RTMP ingest, as shown in the workflow below.

 

Workflow: Real-Time Streaming at Scale With Wowza Streaming Cloud

Real-Time Streaming at Scale for Wowza Streaming Cloud Workflow to support sub-second delivery to millions.
 

Conclusion

No matter what type of streaming architecture you’re trying to build, Wowza makes it happen. Our full-service platform can power any workflow with reliability to boot. We offer protocol flexibility on the ingest side as well as on the delivery side — meaning you’re able to design the best streaming solution for your use case rather than sticking with one prescriptive workflow.

 
 

About Traci Ruether

As a Colorado-based B2B tech writer, Traci Ruether serves as Wowza's content marketing manager. Her background is in streaming and network infrastructure. Aside from writing, Traci enjoys cooking, gardening, and spending quality time with her kith and kin. Follow her… View more