How arut/nginx-rtmp-module works
nginx-rtmp-module adds RTMP ingest, live distribution, playback, and stream-processing features to NGINX. A typical path is an RTMP client publishing a stream, the server handling RTMP commands and codecs, then distributing live media to subscribers or packaging it for HLS/DASH; clients can also request local or HTTP-backed FLV/MP4 playback. Recording, relaying, callbacks, external programs, control, and statistics are additional capabilities. The README documents these product branches; some unsampled module-level wiring is therefore represented only where documented.
Main entry points: ngx_rtmp_live_module.c Live Streams · ngx_rtmp_cmd_module.c RTMP Commands · ngx_rtmp_play_module.c Playback Routing · ngx_rtmp_notify_module.c HTTP Notifications
Components 26
RTMP Protocol
- RTMP Core
ngx_rtmp.c - Session Handling
ngx_rtmp_handler.c - RTMP Commands
ngx_rtmp_cmd_module.c - AMF Encoding
ngx_rtmp_amf.c
Live Media
- Codec Metadata
ngx_rtmp_codec_module.c - Live Streams
ngx_rtmp_live_module.c - Stream Recording
ngx_rtmp_record_module.c
Playback Delivery
- Playback Routing
ngx_rtmp_play_module.c - FLV Playback
ngx_rtmp_flv_module.c - MP4 Playback
ngx_rtmp_mp4_module.c - HLS Packaging
hls/ngx_rtmp_hls_module.c - MPEG-TS Writer
hls/ngx_rtmp_mpegts.c - DASH Packaging
dash/ngx_rtmp_dash_module.c - MP4 Segment Writer
dash/ngx_rtmp_mp4.c
Operations
- Stream Relay
ngx_rtmp_relay_module.c - Worker Auto-push
ngx_rtmp_auto_push_module.c - HTTP Notifications
ngx_rtmp_notify_module.c - HTTP Netcall
ngx_rtmp_netcall_module.c - Event Programs
ngx_rtmp_exec_module.c - HTTP Control
ngx_rtmp_control_module.c
Monitoring
- XML Statistics
ngx_rtmp_stat_module.c
Other components
- RTMP Client
- Media Filesystem
- HTTP Services
- FFmpeg
- RTMP Subscriber
Connections 24
- RTMP Client → RTMP Core: connects to
- RTMP Core → Session Handling: handles sessions
- Session Handling → RTMP Commands: dispatches commands
- RTMP Commands → Live Streams: publishes streams
- Live Streams → Codec Metadata: uses codec metadata
- Live Streams → RTMP Subscriber: distributes live media
- Live Streams → Stream Recording: records streams
- RTMP Commands → Playback Routing: requests playback
- Playback Routing → Media Filesystem: reads media
- Playback Routing → FLV Playback: plays FLV
- Playback Routing → MP4 Playback: plays MP4
- Live Streams → HLS Packaging: packages HLS
- HLS Packaging → MPEG-TS Writer: writes segments
- Live Streams → DASH Packaging: packages DASH
- DASH Packaging → MP4 Segment Writer: writes segments
- Live Streams → Stream Relay: relays streams
- Stream Relay → Worker Auto-push: supports worker pushing
- RTMP Commands → HTTP Notifications: triggers callbacks
- HTTP Notifications → HTTP Netcall: sends HTTP requests
- HTTP Notifications → HTTP Services: calls back
- Live Streams → Event Programs: starts event programs
- Event Programs → FFmpeg: runs transcoder
- HTTP Control → Live Streams: controls clients
- XML Statistics → HTTP Services: serves statistics