Skip to content

Easy to setup dockerized Nginx / RTMP server featuring multi-user authentication and optional per-user push service to Twitch, YT etc.

License

Notifications You must be signed in to change notification settings

alphapialpha/lets-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lets-stream

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.

Prerequisites

  • docker & docker compose
  • git client

Setup

  1. clone this repository: git clone https://github.com/AlphaPiAlpha/lets-stream.git
  2. enter the lets-stream folder: cd lets-stream
  3. copy the auth/auth.json.example to auth/auth.json: cp auth/auth.json.example auth/auth.json
  4. edit the auth.json (see "auth.json explained" section below)
  5. build it: docker compose build
  6. run it: docker compose up -d

"auth.json" explained

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"
        }
    ]
}

User/Stream Paul

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
  • 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 and https://a.upload.youtube.com/FOOBAR_TEST when Paul starts pushing a stream to the server

User/Stream Anna

  • 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
  • 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

Updating the 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!

About

Easy to setup dockerized Nginx / RTMP server featuring multi-user authentication and optional per-user push service to Twitch, YT etc.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published