diff --git a/.github/obs-settings.png b/.github/obs-settings.png new file mode 100644 index 0000000..50031ca Binary files /dev/null and b/.github/obs-settings.png differ diff --git a/README.md b/README.md index 57297e9..5db3581 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,10 @@ Stream Sprout will look for a configuration file in the following locations, in ### Server The `server:` section is used to configure the RTMP server that Stream Sprout will listen on. +`url:` is the URL that Stream Sprout will listen on; it must be an RTMP URL. +If you remotely host Stream Sprout, you should set `key:` to a secure value to prevent unauthorised access. + +```yaml If `archive_stream:` is `true` Stream Sprout will archive the stream to disk in the directory specified by `archive_path:`. ### Services @@ -173,6 +177,9 @@ services: - Select `Custom` from the `Service` dropdown - Copy the server `url:` from your Stream Sprout configuration to the `Server` field: - `rtmp://127.0.0.1:1935` (*default*) +- Copy the `key:` (if you specified one) from your Stream Sprout configuration to the `Stream Key` field + +![OBS Studio Stream Settings](.github/obs-settings.png) ## Limitations diff --git a/stream-sprout b/stream-sprout index f12cb79..0a96c53 100755 --- a/stream-sprout +++ b/stream-sprout @@ -120,11 +120,18 @@ trap ctrl_c INT while true; do echo "Stream Sprout v${VERSION} using ${STREAM_SPROUT_CONFIG}" SERVER_URL=$(yq e ".server.url" "${STREAM_SPROUT_CONFIG}") + SERVER_KEY=$(yq e ".server.key" "${STREAM_SPROUT_CONFIG}") if [[ ! "${SERVER_URL}" =~ ^rtmp://.* ]]; then echo " - Invalid URL: ${SERVER_URL} is not a valid RTMP URL." exit 1 fi - echo " - Server: ${SERVER_URL}" + echo -n " - Server: ${SERVER_URL}" + if [ "${SERVER_KEY}" != "null" ]; then + SERVER_URL+="/${SERVER_KEY}" + echo " (key required)" + else + echo "" + fi STREAM_TEE="" get_stream_tee ffmpeg \ diff --git a/stream-sprout.yaml.example b/stream-sprout.yaml.example index 739c469..556e3a2 100644 --- a/stream-sprout.yaml.example +++ b/stream-sprout.yaml.example @@ -1,5 +1,6 @@ server: url: "rtmp://127.0.0.1:1935" + key: "" archive_stream: false archive_path: "${HOME}/Streams"