Docker image for an RTMP/HLS/MPEG-DASH server running on nginx with SSL support.
1.8K
A docker container based on the original by mvgorcum for ingesting RTMP streams and providing streams to clients. Improved config generation and support for SSL for the stream urls.
Run the container specifying the SERVER_NAME and providing the certificates.
Mount a folder to /var/ssl that contains cert.crt the PEM certificate, cert.key the private key for the cert and pass.txt the PEM passphrase (can be an empty file if no passphase is needed).
| Variable | Default | About |
|---|---|---|
SERVER_NAME | none, required | Sets the server_name of the http server in nginx for example rtmp.exmaple.com. |
DASH_PLAYLIST_LENGTH | 30s | Sets the playlist length for dash, a lower value reduces delay but requires a faster client connection. |
WORKER_PROCESSES | 1 | Sets the number of nginx worker processes. |
RTMP_STREAM_NAMES | live,testing | A comma seperated list of stream names. |
RTMP_CONNECT_URLS | `` | A comma seperated list of connect URLS. |
RTMP_PLAY_URLS | `` | A comma seperated list of play URLS. |
RTMP_PUBLISH_URLS | `` | A comma seperated list of publish URLS. |
RTMP_DONE_URLS | `` | A comma seperated list of done URLS. |
Create a docker-compose.yml with this content:
version: '3.9'
services:
db:
image: longridgehighschool/nginx-rtmp-ssl:latest
restart: always
environment:
SERVER_NAME: rtmp.example.com
volumes:
- /path/to/certs:/var/ssl
ports:
- '1935:1935'
- '8443:443'
Set your stream to custom with a server of rtmp://rtmp.example.com/live where rtmp.example.com is your SERVER_NAME and live is one of your RTMP_STREAM_NAMES. The Stream Key can be anything you want, clients just need to know what it is.
You can then use any streaming player to view the streams using these URLs:
rtmp://<your hostname>/<your stream name>/<your stream key>https://<your hostname>/dash/<your stream name>/<your stream key>.mpdhttps://<your hostname>/hls/<your stream name>/<your stream key>.m3u8Content type
Image
Digest
sha256:5cd8db5f3…
Size
13 MB
Last updated
over 2 years ago
docker pull longridgehighschool/nginx-rtmp-ssl