Dockerfile for streaming to YouTube, Livecoding, and Twtich simultaneously.
- Clone this repository and change the values for YouTube, Livecoding, and
Twitch keys within
nginx.conf
. - Build the image (you'll need to rebuild the image any time you make
modifications to
nginx.conf
) usingdocker build -t nginx-rtmp-stream .
. - Create the directories logs and vids somewhere, keep note of their location.
- Run the docker image using the following:
docker run -p 1935:1935 -p 8080:80 -v /path/to/host/logs:/logs -v /path/to/host/vids:/vids --rm nginx-rtmp-latest
.
- You can confirm if it's functioning by visiting http://localhost:8080/.
- Stream your content to
rtmp://localhost:1935/all/name
withname
being your stream's name (duh). In OBS (or OBS Studio) name will be your stream key. - You should be able to view the output content for each individual stream by
using VLC, MPV, or any other video player with the ability to view network
streams by using the streaming service with your stream name. For example
mpv rtmp://localhost:1935/livecoding/name
will give the output of the Livecoding stream.
Obviously if you do not want to use a service simply turn off its block (live on
to live off
) and also remove the ffmpeg command within application all โฆ
if it has one.
Do the same for the recording of videos; if you don't need that just remove the
mount and turn off the recorder altogether (record all
to record off
).
You may need to change the ingest URLs in nginx.conf
; Be sure to double check
if the ingest URLs are different and need to be changed before moving on.