5.2 KiB
Stream Sprout
Restream a video source to multiple destinations such as Twitch, YouTube, and Owncast.
Made with 💝 for
& ![]()
Introduction
Stream Sprout uses FFmpeg to re-stream a video source to multiple destinations such as Twitch, YouTube, and Owncast.
Get Started
- Install Stream Sprout
- Configure Stream Sprout
- Configure OBS Studio
- Start
stream-sprout - Click the Start Streaming button in OBS Studio
Installation
Debian
yq is available in bullseye-backports, bookworm, trixie and newer.
- Download the Stream Sprout .deb package from the releases page
- Install it with
apt-get install ./stream-sprout_0.1.0-1_all.deb.
NixOS
Stable releases of Stream Sprout are published to FlakeHub for Nix users. See the flake on FlakeHub for more details:
Ubuntu 24.04 and newer
yq is available in Ubuntu 24.04 and newer.
- Download the Stream Sprout .deb package from the releases page
- Install it with
apt-get install ./stream-sprout_0.1.0-1_all.deb.
For Ubuntu versions earlier than 24.04 you can install Stream Sprout from source.
From source
You need to have FFmpeg and yq installed on your system.
git clone https://github.com/wimpysworld/stream-sprout.git
cd stream-sprout
Configure Stream Sprout
Copy the example Stream Sprout configuration file and edit it to suit your needs.
services: are arbitrarily named. Just create an entry for each RTMP destination you want to stream to.
services:
my-rtmp-destination:
enabled: true
rtmp_server: "rtmp://rtmp.example.com/live/"
key: "my_super_secret_stream_key"
Trovo
Here's are example configurations for Trovo.
services:
trovo:
enabled: false
rtmp_server: "rtmp://livepush.trovo.live/live/"
key: "<your_stream_key>"
Twitch
Here's are example configurations for Twitch.
services:
twitch:
enabled: true
rtmp_server: "rtmp://live.twitch.tv/app/"
key: "<your_stream_key>"
Ingest servers
The example configuration uses the primary Twitch ingest server, which is rtmp://live.twitch.tv/app/. If you want to optimise your stream quality, you can use a server closer to your location. A short list of recommended servers based on your location is available from Recommended Ingest Endpoints For You.
You can find a complete list of Twitch ingest servers from https://twitchstatus.com/.
Testing
If you want to test streaming to Twitch without going live, you can use the ?bandwidthtest=true query parameter.
Add ?bandwidthtest=true to the end of your Twitch stream key, this will enable bandwidth testing, which you can monitor at https://inspector.twitch.tv/, and the stream will not go live on your channel.
YouTube
Here's are example configurations for YouTube.
services:
youtube:
enabled: true
rtmp_server: "rtmp://a.rtmp.youtube.com/live2/"
key: "<your_stream_key>"
Configure OBS Studio
- Open OBS Studio
- Go to
Settings>Stream - Select
Customfrom theServicedropdown - Copy the server
url:from your Stream Sprout configuration to theServerfield:rtmp://127.0.0.1:1935
References
These are some of the references used to create this project:
- https://trac.ffmpeg.org/wiki/EncodingForStreamingSites
- https://ffmpeg.org/ffmpeg-protocols.html#rtmp
- https://ffmpeg.org/ffmpeg-formats.html#flv
- https://ffmpeg.org/ffmpeg-formats.html#tee-1
- https://obsproject.com/forum/resources/obs-studio-stream-to-multiple-platforms-or-channels-at-once.932/
- https://stackoverflow.com/questions/16658873/how-to-minimize-the-delay-in-a-live-streaming-with-ffmpeg