explaingit

arut/nginx-rtmp-module

14,010CAudience · ops devopsComplexity · 4/5Setup · hard

TLDR

nginx-rtmp-module plugs live and on-demand video streaming into NGINX, supporting RTMP ingest and HLS or MPEG-DASH delivery so you can self-host a streaming server without third-party services.

Mindmap

mindmap
  root((nginx-rtmp-module))
    What It Does
      Live video streaming
      On-demand video
      Stream recording
    Protocols
      RTMP ingest
      HLS output
      MPEG-DASH output
    Features
      FFmpeg transcoding
      Multi-server relay
      Event webhooks
    Platforms
      Linux FreeBSD
      macOS Windows
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a self-hosted live streaming server that accepts a broadcast from OBS and delivers it to viewers in a browser via HLS.

USE CASE 2

Record live streams to disk automatically while simultaneously serving them to viewers.

USE CASE 3

Use FFmpeg to transcode an incoming stream into multiple resolutions on the fly for adaptive bitrate delivery.

USE CASE 4

Relay streams between servers to distribute load across multiple machines.

Tech stack

CNGINXFFmpegRTMPHLSMPEG-DASH

Getting it running

Difficulty · hard Time to first run · 1h+

Must compile NGINX from source with this module, cannot be added to a pre-built NGINX binary.

In plain English

This project, called nginx-rtmp-module, adds live and on-demand video streaming to NGINX. NGINX is a widely used piece of web server software, and a module like this one plugs extra abilities into it. Once added, NGINX can take in a live video feed, hand it out to viewers, and serve recorded video files. The code is written in C. The README lists what it can do. It handles live streaming over three common methods named RTMP, HLS, and MPEG-DASH, the last two of which are designed to play on phones and in browsers. It can serve video on demand from files stored on the machine, relay streams between servers so the load can be spread out, and record incoming streams to disk. It supports the H264 video and AAC audio formats, can convert video on the fly using a separate tool called FFmpeg, and can call out to your own web addresses when events happen, such as someone starting or stopping a broadcast. It also exposes usage statistics and runs on Linux, FreeBSD, macOS, and Windows, though the README notes several features are not available on Windows. Installing it is part of building NGINX itself. The README shows the commands: from the NGINX source folder you run its configure step while pointing at this module, then compile and install. There are notes for adding SSL support on certain NGINX versions and for building a debug version. Most of the README is a large example configuration file that demonstrates the features in practice. The samples show a broadcast setup with one publisher and many viewers, recording the first part of a stream, restricting who can publish, running FFmpeg to shrink a video's resolution, pulling a webcam feed, pushing streams to other machines, serving stored files, and producing HLS and MPEG-DASH output into temporary folders. A final section shows how to read the streaming statistics over plain HTTP.

Copy-paste prompts

Prompt 1
Show me an NGINX config using nginx-rtmp-module that accepts a live RTMP stream and serves it as HLS to web browsers.
Prompt 2
How do I configure nginx-rtmp-module to record every incoming stream to a file and also relay it to a second NGINX server?
Prompt 3
Write an NGINX config that uses nginx-rtmp-module with FFmpeg to transcode an incoming stream into 720p and 480p outputs.
Prompt 4
How do I compile NGINX from source with nginx-rtmp-module included on Ubuntu, including SSL support?
Prompt 5
Show me how to expose nginx-rtmp-module statistics as a JSON endpoint I can poll for viewer counts and stream health.
Open on GitHub → Explain another repo

← arut on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.