RTMP – Real Time Messaging Protocol Explained

Real Time Messaging Protocol or RTMP is mainly serving for high speed transmission of audio, video and data between flash player and a server. Initially developed by Macromedia, the protocol is now owned by Adobe, and specifications about it have only partially been released for public use.

According to those specifications, the RTMP protocol has multiple variations, i.e. the “plain” RTMP protocol, RTMPS which is RTMP over an TLS/SSL connection, RTMPE which is RTMP encrypted using Adobe’s own security mechanism, and RTMPT which is encapsulated within HTTP requests to traverse firewalls.

How One AI-Driven Media Platform Cut EBS Costs for AWS ASGs by 48%

How One AI-Driven Media Platform Cut EBS Costs for AWS ASGs by 48%

The use of RTMP is to avoid latency in communication, mainly, deliver audio or video streams smoothly, and by splitting them in fragments, make them interleaved and multiplexed over a single connection. Also, you save bandwidth.

Interleaving and multiplexing is done at the packet level, with RTMP packets across several different active channels being interleaved in such a way as to ensure that each channel meets its bandwidth, latency, and other quality-of-service requirements. RTMP defines several virtual channels on which packets may be sent and received, and which operate independently of each other. During a regular RTMP session, several channels may be active simultaneously at any given time.

In result, RTMP encapsulates MP3 or AAC audio and FLV1 video multimedia streams, and can make remote procedure calls, or RPCs.

The Original Flash Streaming Protocol

RTMP is also considered the original flash streaming protocol as developed by Macromedia, then Adobe for streaming audio, video, and data, between Flash media Server and Flash player. A two way connection is established between Flash server and Flash player which allows for a real-time communication back and forth. Example of data that can be communicated is:

  • prerecorded data
  • live video data
  • live audio data
  • text chat
  • coordinates X and Y in a multiplayer game, for example
  • and more…

How it Works?

Flash player first contacts the Flash media server and an RTMP connection is then established. An RTMP connection is said to begin with a “handshake”. Flash player requests a specific stream, for example – video. Once the media server receives the request (for the stream), it is sent to Flash SWF directly over the RTMP connection. The same stream can be sent to any number of clients that request it, provided the bandwidth is good enough on both sides to deliver all the simultaneous streams. Additional media servers can be chained together, which in result improves capacity, or allows for – large events.

What it Looks Like?

Protocol packets contain a header and a body which, in the case of connection and control commands, is encoded using the Action Message Format (AMF).

A diagram depicting a structured data format with fields such as stream id
RTMP packet structure
Image source: Wikimedia Commons
Diagram showing the structure of a chunk header with various fields.
RTMP headers
Image source

Basic Header is the only constant part of the packet, composed of a single byte, and the rest of the packet is the stream ID. The basic header can be extended with 2 or 3 extra bytes. The Chunk Message Header contains meta-data information such as the message size, timestamp and message type. This last value is a single byte and defines whether the packet is an audio, video, command or “low level” RTMP packet (e.g. RTMP Ping).

You can download Adobe RTMP specification here.

About GlobalDots

With over 10 years of experience, GlobalDots have an unparallel knowledge of today’s leading web technologies. Our team know exactly what a business needs to do to succeed in providing the best online presence for their customers. We can analyse your needs and challenges to provide you with a bespoke recommendation about which services you can benefit from.

GlobalDots can help you with the following technologies: Content Delivery Network, DDoS Protection, Multi CDN, Cloud performance optimization and infrastructure monitoring.

Latest Articles

Three Ways CISOs Can Combat Emerging Threats in 2025

73% of CISOs fear a material cyberattack in the next 12 months, with over three-quarters convinced AI is advancing too quickly for existing methods to combat it. But what can CISOs do to prepare for the coming wave – and access the resources they need to deal with this evolving threat landscape? To find out, […]

11th November, 2024
How Optimizing Kafka Can Save Costs of the Whole System

Kafka is no longer exclusively the domain of high-velocity Big Data use cases. Today, it is utilized on by workloads and companies of all sizes, supporting asynchronous communication between even small groups of microservices.  But this expanded usage has led to problems with cost creep that threaten many companies’ bottom lines. And due to the […]

Itay Tal Head of Cloud Services
29th September, 2024
Migrating Volumez RedHat VMs into Amazon Linux 2 for higher effective discounts rate of Saving Plan

A cloud data infrastructure company relied on extensive use of multiple instance types to test its products. But this made it difficult to optimize costs – a fact which had begun to impact their ability to scale the business.   The GlobalDots team helped the company identify and implement a new infrastructure configuration that both saved […]

Itay Tal Head of Cloud Services
19th September, 2024
How Yuki Achieved SOC 2 Compliance 6x Faster

Overview A fast-growing Snowflake optimization platform was missing out on customers because they didn’t have the right data security compliance. Through multiple consultations and extensive vendor-testing, the GlobalDots team selected a solution to provide both tech and human support, helping the company achieve SOC 2 compliance within just 3 months – and win new customers […]

Itay Tal Head of Cloud Services
16th September, 2024

Unlock Your Cloud Potential

Schedule a call with our experts. Discover new technology and get recommendations to improve your performance.

    GlobalDots' industry expertise proactively addressed structural inefficiencies that would have otherwise hindered our success. Their laser focus is why I would recommend them as a partner to other companies

    Marco Kaiser
    Marco Kaiser

    CTO

    Legal Services

    GlobalDots has helped us to scale up our innovative capabilities, and in significantly improving our service provided to our clients

    Antonio Ostuni
    Antonio Ostuni

    CIO

    IT Services

    It's common for 3rd parties to work with a limited number of vendors - GlobalDots and its multi-vendor approach is different. Thanks to GlobalDots vendors umbrella, the hybrid-cloud migration was exceedingly smooth

    Motti Shpirer
    Motti Shpirer

    VP of Infrastructure & Technology

    Advertising Services