RTMP Server Comparison
A practical comparison of open-source RTMP server options for live streaming, based on notes from a real project.
We needed to add live streaming to a client's project. For several reasons, using the RTMP protocol became a requirement. In this article, I will share my experience with a few RTMP server options.
Live streaming can be expensive, especially once traffic and concurrent load start to matter. Given the client's budget constraints and expected usage, we decided that open-source solutions would be a reasonable fit. During the process, we tested the following options:
Nginx RTMP
Nginx RTMP is a module built on top of Nginx. With this module, you can serve RTMP streams through Nginx. To set up an RTMP server, you need to compile Nginx with the module enabled. We were able to set up the installation and test environment quickly. Since it is a module, it does not offer a broad feature set; it mainly provides a basic statistics screen.
It does its job well. Its limits are clear, and if those limits are acceptable for your use case, I can recommend it. Resource usage is much lower than the other options we tested, and its performance under load is strong. The configuration is also simple and easy to understand.
SRS
SRS is a more advanced RTMP server. Unlike Nginx RTMP, it comes with many features and supports protocols such as WebRTC, HLS, and HTTP-FLV. During our tests, v4 was the stable version, while v5 had more features but was not stable enough for us. You can install it quickly with Docker, but the interface can feel confusing and some parts may appear in Chinese.
We had a handshake problem between SRS and the mobile library we were using. Solving it took extra effort because the solution we found was in Chinese. Since we could not solve the problem on v4, we moved to v5. Then we ran into a different stability issue: the application would occasionally crash at random. For that reason, we decided not to use SRS. This was specific to our use case and mobile libraries, so SRS may still be a very good option for your project.
Node Media Server
Node Media Server is an RTMP server written in Node.js. In terms of features, the ranking would be: SRS > Node Media Server > Nginx RTMP. Installation is simple and fast. Since it is written in Node.js, it is also easy to customize. The tradeoff is resource usage; among the options we tested, it consumed the most resources. On the other hand, Node Media Server had the cleanest and simplest interface.
We did not have problems with mobile library support in the earlier versions we tested, but issues appeared later. The lack of active maintenance was a negative factor for us.
Conclusion
Here is a general evaluation:
- Installation: Ease of installation
- Interface: Ease of use of the provided interface
- Resource Consumption: Resource usage
- Features: Features offered
- Maintenance: Active maintenance process
| Installation | Interface | Resource Consumption | Features | Maintenance | |
|---|---|---|---|---|---|
| Nginx RTMP | 3 | 3 | 1 | 3 | 2 |
| SRS | 2 | 2 | 2 | 1 | 1 |
| Node Media Server | 1 | 1 | 3 | 2 | 3 |
1 = good, 2 = medium, 3 = poor
Our final choice was Nginx RTMP. Your decision should depend on your own constraints, especially feature requirements, expected load, and maintenance expectations.