NGINX is open-source software for web serving, caching, reverse proxying, media streaming, load balancing, and more. Originally developed as a web server for delivering websites, it has evolved into a multifaceted solution for proxying content making it one of the most widely deployed web servers in use today. In order to address scaling issues with… Continue reading 3 Reasons NGINX Video Streaming Falls Short
NGINX is open-source software for web serving, caching, reverse proxying, media streaming, load balancing, and more. Originally developed as a web server for delivering websites, it has evolved into a multifaceted solution for proxying content making it one of the most widely deployed web servers in use today.
In order to address scaling issues with plain RTMP streaming, NGINX added RTMP support. That provided high-level performance and stability for live streaming over less scalable solutions like Wowza and Flash Media Server.
RTMP (Real-Time Messaging Protocol) is an application-level protocol owned by Adobe. It was originally designed for delivering on-demand media and live media (i.e., live audio, video, and data) over the Internet between a Flash player and RTMP media server.
Despite the historical reliability of NGINX and RTMP, they face three major shortcomings that make them less useful for modern video streaming.
RTMP Does Not Work in the Browser
Browser support is incredibly important due to the high number of viewers that use internet browsers to watch video. Without browser support, it is harder for your viewers to watch your stream.
RTMP will not run on an internet browser because it does not have HTML5 support. Furthermore, Flash player has been phased out as of 2021, rendering it an unworkable solution. The only way to get RTMP to play in the browser is to stream it over HTTP which will negatively affect performance especially in regards to latency. So when it comes to RTMP streaming, you have two bad options: no one watching the stream or watching a stream with poor performance.
Of course, you can certainly build a native app for playing video through RTMP on iOS and Android. However, this is not a great solution as the RTMP protocol has limitations. RTMP has trouble dealing with poor network conditions, and low bandwidth may cause interruptions. It does not have the adaptability of other UDP-based protocols such as SRT and WebRTC.
TCP-Based RTMP Creates High Latency
RTMP is a TCP (Transmission Control Protocol) based protocol. It runs on the transport layer and is used for sending bits of data — known as packets — over the Internet. It is a connection-oriented protocol with built-in packet retransmission and error recovery. This means that back-and-forth communication is required to reorder packets and ensure their accurate delivery. The process of constantly exchanging messages introduces latency in many networking scenarios.
Latency is a problem for creating effective live-streaming applications. Any sort of a delay between when the broadcaster captures the video and the subscriber views that video, creates unnatural gaps, negatively affecting communication and disrupting a smooth exchange of information.
UDP is a much better protocol for video streaming, and it’s one of the fundamental reasons that WebRTC is a superior protocol over RTMP.
Issues with Firewalls and Encryption
The majority of RTMP content is routed through the non-standard port 1935 rather than the standard HTTP port 80 which leaves it vulnerable to being blocked by (corporate) firewalls. While this issue can be overcome by streaming in RTMPT (tunneling over HTTP), it has a negative effect on server and client performance.
Basically, when you use RTMPT, you are pulling the data over HTTP in small chunks. If you are already using this approach, you might as well use HLS which is supported in browsers. We’ve already discussed the many limitations of HLS and other related protocols, so we won’t go into that here.
The Solution: WebRTC and Red5 Pro
Red5 Pro’s WebRTC solution solves all these issues. WebRTC has native browser support for plugin-free support of all major browsers. WebRTC uses UDP for faster stream delivery, and it uses STUN/TURN for tunneling through firewalls without affecting performance.
For more information, please send a message to info@red5.net or schedule a time to talk with us.