Before you go, check out these stories!

0
Hackernoon logoThe Best Alternative to RTMP: A WebRTC Migration by@@hamitdemir

The Best Alternative to RTMP: A WebRTC Migration

Author profile picture

@@hamitdemirAnt Media Server

Ant Media provides a scalable and adaptive WebRTC based Ultra Low Latency Video Streaming Platform.

With the announcement that Adobe will stop supporting Flash, people started looking for an alternative solution to RTMP. With the shrinkage of time, the question of moving to which solution from RTMP has gained importance. Experts strongly recommend RTMP to WebRTC migration as an answer.

Flash And RTMP are Dying

Adobe Communications Team made an announcement in 2017. 

“Given this progress, and in collaboration with several of our technology partners – including Apple, Facebook, Google, Microsoft and Mozilla – Adobe is planning to end-of-life Flash. Specifically, we will stop updating and distributing the Flash Player at the end of 2020 and encourage content creators to migrate any existing Flash content to these new open formats.”  

Adobe Communications Team 

July 25, 2017 

So as 2020 comes to a halt, so does the life of Flash Player and also RTMP. Adobe will stop updating and distributing the Flash Player. 

For a while, many Flash video streaming applications have been replaced by HTML5 solutions such as HTTP Live Streaming (HLS) and DASH (most of them only in the last 5 years when HTML5 browsers have finally offered media source and encrypted media extensions). But during this time, WebRTC was and still is the only option for ultra-low latency streaming. Even only this makes it a great alternative to RTMP.

As an HTML5-based solution, WebRTC does not require any browser plug-ins for playback and can utilize mapping techniques to transfer data between connected sessions. Moreover, WebRTC offers the quickest method for transporting live video across the internet. 

If you’re using Flash for low-latency/real-time streaming, you have a really short time for RTMP to WebRTC migration.  

Let’s discuss what RTMP and WebRTC are.

RTMP 

RTMP is a protocol, created by Macromedia and now owned by Adobe, that provides high-performance transmission of video, audio and data between dedicated streaming servers and Adobe Flash Player across the internet. 

Definition of RTMP by 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 is created for high-performance transmission of media such as audio and video data. 

WebRTC 

One of the biggest advantages of WebRTC is that it converts millions of browsers into streaming terminals without the need to install any additional plugins. What’s more, WebRTC supports sub-second latency, which means no more delay! Finally, the protocol uses an adaptive bitrate technology that allows it to automatically adjust video quality and avoid any interruptions. Sounds good right?

Reasons for RTMP to WebRTC Migration

We have briefly mentioned RTMP and WebRTC protocols. Now, we can look at the reasons for RTMP to WebRTC migration.

RTMP vs WebRTC 

With the death of the flash player, you have to consider the new options. There is one option for ultra-low latency streaming - WebRTC. We will compare these two protocols step-by-step so you understand why the benefits of RTMP to WebRTC migration.

Latency 

RTMP is based on Transmission Control Protocol (TCP), and it allows data transmission in a given sequence and order with a delivery guarantee. Even it uses a more reliable network connection, latency is often 5 seconds or more dependent on network settings. On the other hand, WebRTC is based on UDP, and it offers near real-time latency with ~0.5 seconds. WebRTC is arguably better for two-way conferencing or real-time device control. Latency is one of the most important reasons for RTMP to WebRTC migration.

Scalability 

In terms of scalability, RTMP can be scaled to provide live streaming to thousands or even millions of audiences. Likewise, WebRTC can scale to millions. 

Encoder/Player and Browser Support 

Due to the wide adoption of RTMP, it is supported by most encoder software and video players. However, due to the end the Flash player, RTMP starts to lose support by most modern browsers. On the other hand, WebRTC has better support by modern browsers with built-in API support in HTML5 and can be played within most modern browsers without installing any software or plugins. In terms of encoder or video player support, lots of software vendors started to recognize the popularity of WebRTC and started to add WebRTC into their support list. 

API Support 

When it comes to development, API support is a key factor in choosing your technology. WebRTC is taking the lead for API support, as most modern browsers have native API integrated with WebRTC and can be called directly using Javascript. On the other hand, to work with RTMP you need to leverage open source libraries or use pre-existing software solutions. 

WebRTC Data Channels

Sending data between two browsers for communication, gaming, or file transfer can be a rather involved process. It requires setting up and paying for a server to relay data and perhaps scaling this to multiple data centers. In this scenario, there is potential for high latency, and it’s difficult to keep data private.

These problems can be alleviated by using WebRTC’s RTCDataChannel API to transfer data directly from one peer to another. 

Previously published at https://antmedia.io/rtmp-to-webrtc-migration-rtmp-is-dying/

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.