It’s time for another interesting Whiteboard Wednesday session to make your streaming journey easier. In today’s blog, we will be taking a closer look at what RTMP is and how RTMP live streaming works. As online video streaming becomes more popular in its adoption across various industries, modern technology has started to emerge to support its widespread adoption. One particular streaming technology that had helped shape the evolution of live streaming standards is RTMP or Real Time Messaging Protocol. In this post, we are going to break down everything you need to know about RTMP and how it relates to live streaming.
What is RTMP
The RTMP or Real Time Messaging Protocol is a Transmission Control Protocol-based technology originally developed by the predecessor of Adobe to work with the Adobe Flash player. It 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.
Originally, RTMP was used to transmit content between a video player and a hosting server, which was referred to as “RTMP delivery.” Although the Flash Player technology is getting near its deprecating day, RTMP server hosting remains one of the top choices of streaming platforms. For example, it is still being used as an ingest protocol by Facebook Live, YouTube, and Twitch.
RTMP Compatible Audio and Video Codecs
Audio Codecs– AAC, AAC-LC, HE-AAC+V1 and V2, OPUS, MP3, SPEEX, VORBIS
Video Codecs– H.264, VP6, VP8
What is RTMP Ingest?
Nowadays the purpose of RTMP live streaming has changed as in RTMP’s primary role now is to deliver content from an on premise or cloud encoder to an online video hosting platform. This procedure is referred to as “RTMP ingest.” RTMP ingest is the process of using the RTMP technology for encoding and delivering the live video from the encoder to the online video platform.
The Three Step Process of RTMP Ingest
There are three distinct parts that make RTMP ingest work:
1. The Handshake– The process of RTMP live streaming begins with a handshake between the client wishing to stream media and the online video platform/live streaming server delivering that video or audio content. It involves the following steps:
- The client lets the server know which version of the RTMP protocol it is using after which the client sends a timestamp
- The server responds with an echo of the information received by the client and includes a timestamp of the time it received them.
- The client sends a final packet that is a copy of the timestamp packet and the server returns it.
- Once the final packet exchange is complete, the handshake is considered complete.
2. The Connection– The connection is the second step that involves a coded dialogue exchange between the client and the server where the client sends a connect request and the server responds with an all-clear.
3. The Stream– The player on the client’s device begins streaming the video from the server using the communication protocol.
This sequence of RTMP live streaming happens very fast- in a matter of a few seconds. The workflow is technical but live streamers don’t need to worry about this if they have opted for a secure and stable live streaming server .
Advantages of RTMP Live Streaming Protocol
Although the Flash Player has been depreciated, no one can deny the many benefits that RTMP offers for live streaming:
- RTMP is capable of low-latency streaming upto 5 seconds, which is a major plus for live streaming.
- It is also known for its minimal buffering, which truly enhances the user experience.
- RTMP lets users integrate many different media types into one source. This means it’s possible to blend audio, video, and text together.
- RTMP is a flexible protocol as the live streaming feeds can be consumed in the order the viewer chooses. This allows for a better user experience for users to rewind videos, skipped and fast forwarded.
How does RTMP Live Streaming Work
A typical RTMP live streaming workflow follows this process- the live video travelling in this particular route:
Camera → Encoder → Online Video Platform/ Live Streaming Server → CDN → Video Player
The First Mile– When a live video feed is picked up by a camera and sent to an online video platform or media server via an encoder is called the first mile.
The Last Mile– When the processed feed is scaled and sent through a Content Delivery Network (CDN) for distribution over internet protocol to the viewer’s device, this part is called the last mile where the stream is delivered to the Flash Player on the user’s end.
However, the use of Flash player has depreciated and therefore RTMP is no longer being used in the last mile. At this point RTMP is taken up by other protocols for playback on mobile devices, laptops etc. For the first mile, though, RTMP is still widely used.
Because today’s HTML5 players require HTTP-based protocols, an online video platform ingests an RTMP stream while transcoding it into a more playback-friendly alternative like HLS. Whether the RTMP stream is coming from an IP camera, a cloud encoder, or from a mobile phone, makes the conversion and delivery process seamless.
For more information about streaming protocols, read our blog Comparing SRT, HLS, and MPEG-DASH: Which Streaming Protocol to Choose?
Is RTMP Dead?
Initially, RTMP was the de facto standard for live streaming. However due to security issues and the emergence of latest technology, introducing the need to send live streams to mobile devices, tabs and not just browsers, the Flash Player lost its once established popularity ultimately leading to its depreciation.
Thus new protocols emerged and streaming media servers adapted to handle the changing streaming standards. However, one common misconception is that RTMP is dead. Although Adobe Flash player- the video player that originally used this technology is practically dead, RTMP itself is still valuable in live streaming. RTMP is still widely used in the first mile of video streaming and media servers transcode the RTMP stream into HLS and other compatible formats for playback in the HTML5 video player. Thus RTMP ingest for HLS is not dead and many social media platforms including Facebook, YouTube and Twitch use it.
There you go! Hope you could clearly explain the concept of RTMP and how it works!
Don’t forget to share your thoughts in the comment section below. You can also tag @Muvi with #WhiteboardWednesday on Twitter and share your thoughts.
See you in our next Whiteboard Wednesday segment. Till then Happy Streaming with Muvi!
Sign Up for our 14-day Free Trial, now!