Introduction to the NGINX RTMP Module
Live streaming
has become a cornerstone of modern digital communication, powering everything from esports broadcasts to online education and interactive webinars. At the heart of many open-source streaming setups is the nginx rtmp module—a lightweight, high-performance solution for real-time video delivery. The nginx rtmp module enables developers and businesses to deploy scalable live and on-demand video streaming infrastructure using the reliable NGINX web server.Key use cases for the nginx rtmp module in 2025 include live event broadcasting, video conferencing, e-learning platforms, social media live feeds, and secure enterprise streaming. Its flexibility, compatibility with open standards, and a strong developer community make it a go-to choice for custom streaming solutions across industries.
What is the NGINX RTMP Module?
The nginx rtmp module is an open-source extension for the NGINX web server, designed specifically for efficient real-time media streaming. It implements the Real-Time Messaging Protocol (RTMP) and extends support to HTTP
Live Streaming
(HLS) and MPEG-DASH, enabling multi-device compatibility for live broadcasts and on-demand content.Supported protocols include:
- RTMP: A low-latency protocol ideal for ingesting streams from encoders like OBS or XSplit.
- HLS: Apple’s adaptive bitrate streaming over HTTP; widely used for playback on mobile and web clients.
- DASH: Open standard for adaptive streaming; suitable for modern browsers and smart TVs.
Typical nginx rtmp module applications span industries such as:
- Online education and virtual classrooms
- Corporate video streaming and webinars
- Esports and gaming tournaments
- Social media live integrations
- Video-on-demand (VOD) services
For developers looking to integrate interactive features such as real-time communication, leveraging a
Video Calling API
alongside nginx rtmp can significantly enhance user engagement and collaboration within streaming platforms.
Key Features of the NGINX RTMP Module
The nginx rtmp module offers a robust set of features tailored for both simple and complex streaming scenarios:
- Live Streaming: Ingest and distribute live video via RTMP, HLS, and DASH protocols.
- Video On Demand (VOD): Serve pre-recorded content over adaptive protocols.
- Stream Relay & Distributed Streaming: Relay streams to other servers or CDNs for scalability and redundancy.
- Transcoding & Recording: Integrate with FFmpeg for real-time transcoding, format conversion, and stream recording.
- Security Features: IP-based access control, token authentication, and HTTPS/SSL support for secure media delivery.
If you’re building cross-platform streaming apps, you might also consider integrating
webrtc android
orflutter webrtc
solutions to enable seamless real-time communication on mobile devices.With its modular approach and configuration flexibility, the nginx rtmp module adapts to the evolving needs of streaming platforms in 2025.
Installing the NGINX RTMP Module
System Requirements and Compatibility
The nginx rtmp module is compatible with most modern Linux distributions (Debian, Ubuntu, CentOS, RedHat, Alpine, FreeBSD) and can be compiled for Windows and macOS. It requires NGINX (open source or NGINX Plus) version 1.9 or above, GCC or Clang for compilation, and optional dependencies like FFmpeg for transcoding.
If you’re seeking a
jitsi alternative
for video conferencing or collaboration features, integrating such solutions with your NGINX RTMP setup can provide enhanced flexibility and scalability.Installation Methods
Installing on Linux (Debian/Ubuntu, CentOS/RedHat, Alpine, FreeBSD)
You can install the nginx rtmp module by compiling NGINX from source with the module, or by using pre-built packages where available. Here are sample commands for various operating systems:
Debian/Ubuntu:
bash
sudo apt-get update
sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev zlib1g-dev
wget https://nginx.org/download/nginx-1.25.0.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/refs/heads/master.zip
unzip master.zip
cd nginx-1.25.0
./configure --add-module=../nginx-rtmp-module-master --with-http_ssl_module
make && sudo make install
CentOS/RedHat:
bash
yum groupinstall 'Development Tools'
yum install pcre pcre-devel zlib zlib-devel openssl openssl-devel
wget https://nginx.org/download/nginx-1.25.0.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/refs/heads/master.zip
unzip master.zip
cd nginx-1.25.0
./configure --add-module=../nginx-rtmp-module-master --with-http_ssl_module
make && make install
Alpine Linux:
```bash
apk add build-base pcre-dev openssl-dev zlib-dev
Follow similar steps as above for source compilation
1
2**FreeBSD:**
3
bash
pkg install nginx
Or compile from source for custom modules
1
2For those who want to quickly add video communication to their web apps, you can [embed video calling sdk](https://docs.videosdk.live/prebuilt/guide/prebuilt-video-and-audio-calling/getting-started) solutions directly, streamlining the integration process with minimal code.
3
4#### Installing with or without NGINX Plus
5
6NGINX Plus users must build the nginx rtmp module as a dynamic module. Reference the [NGINX Plus dynamic module guide](https://docs.nginx.com/nginx/dynamic-modules/) for detailed instructions. For open-source NGINX, module compilation is typically static.
7
8## Configuring the NGINX RTMP Module
9
10### Basic nginx.conf Setup
11
12A minimal configuration for the nginx rtmp module establishes an RTMP server listening on port 1935 and enables HLS output for broad device compatibility.
13
14
nginx
rtmp {
server {
listen 1935;
chunk_size 4096;
1 application live {
2 live on;
3 hls on;
4 hls_path /tmp/hls;
5 hls_fragment 3;
6 }
7}
}
http {
server {
listen 8080;
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /tmp;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
}
}
}
```
If you’re developing with React, implementing a
react video call
feature can complement your live streaming setup, offering interactive video experiences alongside broadcast content.Advanced Use Cases
Multiple Applications
You can define multiple applications within the rtmp block for different use cases (e.g., live, vod, relay):
1rtmp {
2 server {
3 listen 1935;
4 application live {
5 live on;
6 }
7 application vod {
8 play /var/media;
9 }
10 application relay {
11 push rtmp://other-server/live;
12 }
13 }
14}
15
HLS/DASH Configuration
Enable both HLS and DASH for adaptive streaming:
1rtmp {
2 server {
3 listen 1935;
4 application live {
5 live on;
6 hls on;
7 hls_path /tmp/hls;
8 hls_fragment 3;
9 dash on;
10 dash_path /tmp/dash;
11 dash_fragment 3;
12 }
13 }
14}
15
Stream Relay and Transcoding with FFmpeg
To relay streams or perform on-the-fly transcoding, integrate FFmpeg with nginx rtmp module hooks:
1rtmp {
2 server {
3 listen 1935;
4 application transcode {
5 live on;
6 exec ffmpeg -i rtmp://localhost/transcode/$name -c:v libx264 -c:a aac -f flv rtmp://localhost/live/$name;
7 }
8 }
9}
10

Best Practices and Performance Optimization
To maximize nginx rtmp module performance and reliability in 2025:
- Buffering & Memory Management: Tune
chunk_size
,hls_fragment
, and server buffers to match your expected concurrency and bitrate. - Security: Use IP whitelisting, token-based authentication, and encrypt HTTP endpoints with SSL/TLS. Limit publishing permissions to trusted encoders.
- Monitoring & Stats: Enable nginx rtmp module stats API and monitor logs for stream health. Integrate with external monitoring tools (e.g., Prometheus, Grafana) for real-time insights.
For those who want to experiment with advanced video streaming and conferencing features, you can
Try it for free
and explore how these tools can enhance your streaming infrastructure.Example: Enabling stats location in nginx.conf
nginx
http {
server {
listen 8080;
location /stat {
rtmp_stat all;
allow 127.0.0.1;
deny all;
}
}
}
Common Issues and Troubleshooting
- Installation Issues: Ensure all dependencies are installed before compilation. Review build logs for missing libraries.
- Streaming Interruptions: Network instability or encoder misconfiguration can cause stream drops. Check encoder logs, RTMP connection status, and bandwidth limits.
- Log Analysis Tips: Increase NGINX log verbosity for troubleshooting. Analyze
/var/log/nginx/error.log
and access logs for RTMP events.
If your streaming workflow requires robust real-time communication, consider integrating a
Video Calling API
to add interactive capabilities and improve user engagement.Alternatives and Limitations
While the nginx rtmp module is powerful, it has limitations:
- Lacks native DRM and advanced analytics
- Fewer built-in clustering features compared to commercial servers
- HLS/DASH support is basic (no advanced playlist manipulation)
Alternatives include Wowza Streaming Engine, SRS (Simple Realtime Server), and Nimble Streamer—each offering unique features and commercial support.
Conclusion
The nginx rtmp module continues to be a leading open-source choice for building live and on-demand streaming platforms in 2025. Its flexibility, protocol support, and active community make it ideal for custom streaming solutions. Explore the nginx rtmp module further to unlock scalable, secure, and high-performance streaming experiences tailored to your project’s needs.
Want to level-up your learning? Subscribe now
Subscribe to our newsletter for more tech based insights
FAQ