Go to file
2024-04-10 15:34:11 -05:00
html Converted to rootless 2022-01-16 19:50:00 -06:00
js Removed source mapping URL 2020-11-01 13:54:58 -05:00
licenses Added licenses for included software 2020-11-01 18:46:04 -05:00
nginx Fixed port 8080 redirect issue 2022-02-04 13:31:50 -06:00
scripts Fixed whitespace 2020-11-01 18:25:29 -05:00
build.sh Removed multiarch build support 2023-06-14 09:23:38 -05:00
Dockerfile Bump OpenSSL to v3.3.0 2024-04-10 15:34:11 -05:00
passwd Replace distroless with scratch for base image 2024-03-05 08:21:01 -06:00
README.md I swear I'm done updating the README 2021-06-06 21:50:21 -05:00

NGINX RTMP Relay

Building the image

A minimal container for ingesting and playing back RTMP streams via the HLS or DASH protocols.

To build the image, clone the repository and run the following command, optionally specifying an nginx version to build:

./build.sh [nginx_version]

Optionally, you can specify the Docker registry to be used by prepending the REGISTRY environment variable:

REGISTRY=docker.seedno.de/seednode ./build.sh

If no registry is specified, the images will be built as local/nginx-rtmp:<version>.

If a registry is specified, the built images will be pushed to it once the build is finished.

If you would like images to also be tagged as latest, you can specify LATEST=yes as an environment variable:

LATEST=yes ./build.sh

These environment variables and arguments can be combined:

REGISTRY=docker.seedno.de/seednode LATEST=yes ./build.sh 1.21.0

The resulting images from the above command might look like this:

sinc@crimson ~ docker images
REPOSITORY                                      TAG            IMAGE ID       CREATED        SIZE
docker.seedno.de/seednode/nginx-rtmp            1.21.0         6e60200a2454   7 hours ago    18.2MB
docker.seedno.de/seednode/nginx-rtmp            latest         6e60200a2454   7 hours ago    18.2MB

Running the container

DASH streams are stored inside the container in /var/www/html/dash, and HLS streams are stored in /var/www/html/hls.

Make sure to store these persistently if you want them to remain after stopping the container.

For example, to store the VODs in corresponding directories within your user home directory:

docker run --detach --rm --mount type=bind,source=${HOME}/dash,destination=/var/www/html/dash --mount type=bind,source=${HOME}/hls,destination=/var/www/html/hls local/nginx-rtmp:latest

Make sure these directories exist prior to running the above command.

Streaming with OBS

To stream via OBS, under the Stream section:

Set Service to Custom...

Set Server to rtmp://your.ip.address.here/dash for DASH or rtmp://your.ip.address.here/hls for HLS

Set Stream Key to the directory you'd like to stream to, for example a stream key of seednode would result in the following paths:

DASH stream: http://your.ip.address.here/dash/seednode/

HLS stream: http://your.ip.address.here/hls/seednode/

VODs: http://your.ip.address.here/vods/seednode/