This project builds a Docker image that compiles NGINX from source with
nginx-rtmp-module enabled and ships
an nginx.conf focused on recording incoming RTMP streams to disk.
Container command:
nginx -g 'daemon off;'The image exposes:
1935for RTMP ingest80for the RTMP stats HTTP endpoint
Recordings are saved to the /recordings directory in the flv file format.
The default RTMP application is record:
live on;allows live publishingrecord all;records incoming streamsrecord_path /recordings;stores files in the mounted volumerecord_suffix -%d-%b-%y_%H-%M-%S.flv;appends a timestamp to filenames
Example publish URL pattern:
rtmp://<host>:1935/record/<stream-key>
The HTTP server on port 80 exposes /stat for RTMP statistics (XML).
docker build -t nginx-rtmp-recorder .docker run --rm \
-p 1935:1935 \
-p 8080:80 \
-v "$(pwd)/recordings:/recordings" \
nginx-rtmp-recorderffmpeg -re -stream_loop -1 -i input.mp4 \
-c copy -f flv rtmp://localhost:1935/record/testYou should see timestamped .flv recordings appear in ./recordings.
- This repository is not currently positioned as production-ready. Review the configuration before production use.
- There is no security on any of the APIs within this image. You should not expose this image to the internet.