Easy to setup dockerized Nginx / RTMP server with multi-user authentication as an ingest for RTMP streams. The system furthermore provides outgoing RTMP streams for any incoming stream also protected by (optional) authentication for easy integration into your OBS, to play back in VLC, etc. It can also automatically push any incoming stream to multiple external services at once like Twitch, YT, etc.
- docker & docker compose
- git client
- clone this repository:
git clone https://github.com/AlphaPiAlpha/lets-stream.git
- enter the lets-stream folder:
cd lets-stream
- copy the auth/auth.json.example to auth/auth.json:
cp auth/auth.json.example auth/auth.json
- edit the auth.json (see "auth.json explained" section below)
- build it:
docker compose build
- run it:
docker compose up -d
The example auth.json file looks like this and it consists of three main sections:
- publish for incoming streams pushed to the server
- play for outgoing streams to play back somewhere else
- stream for streams to be pushed to third party services, e.g. Twitch.
For the publish
and play
section the name value always represents the name of the stream protected by the key value.
For the publish
section the name value represents the name of the stream while url contains the url the stream will be automatically pushed to.
Important
All entries for name, key and url are case sensitive
The example file provides all the configuration data for two streams (or users) named Paul and Anna.
{
"publish": [
{
"name": "Paul",
"key": "SuperSecretKey"
},
{
"name": "Anna",
"key": "AnotherSecretKey"
],
"play": [
{
"name": "Paul",
"key" : "PlayBackKey"
},
{
"name": "Anna",
"key" : ""
}
],
"stream": [
{
"name": "Paul",
"url" : "rtmp://live.twitch.tv/app/live_FOOBAR_TEST"
},
{
"name": "Paul",
"url" : "https://a.upload.youtube.com/FOOBAR_TEST"
}
]
}
Paul is configured as follows:
- Paul can stream to the server via RTMP from any app like OBS with the following settings:
- Server:
rtmp://SERVER_IP/live
- Stream Key:
Paul?key=SuperSecretKey
- Server:
- Paul's stream can be received by any app like OBS or VLC via the following url:
rtmp://SERVER_IP/live/Paul?key=PlayBackKey
- Paul's stream will be automatically pushed to the two urls
rtmp://live.twitch.tv/app/live_FOOBAR_TEST
andhttps://a.upload.youtube.com/FOOBAR_TEST
when Paul starts pushing a stream to the server
- Anna can stream to the server via RTMP from any app like OBS with the following settings:
- Server:
rtmp://SERVER_IP/live
- Stream Key:
Anna?key=AnotherSecretKey
- Server:
- Anna's stream is NOT protected by a key and can be received by any app like OBS or VLC via the following url:
rtmp://SERVER_IP/live/Anna
- Anna does not have any entries in the stream section, so her stream to the server will not be automatically pushed somewhere else
Important
Pay attention to upper and lower case for names and keys in the urls above, they have to exactly match the entries in your auth.json
You can edit the auth/auth.json
without a problem while the system is running. No need to restart the containers.
Important
Don't use editors that create a new file when editing (e.g. vim). This breaks the bind-mount, which is based on inode!