So you’d like to expand your audience and stream to Twitch, Kick and Youtube at the same time.
In this HowTo I’ll try to explain how that’s done.
I will include IRL streaming and desktop streaming.
IRL streaming has 1 additional middleware versus desktop streaming.
We need a Linux server, dedicated or VPS. You can do it with Windows, but I will not cover that.
First let’s talk about restreaming aka multistreaming or sending a video to multiple destinations.
You need nginx with the rtmp module. In Ubuntu it’s called “libnginx-mod-rtmp”.
apt install nginx libnginx-mod-rtmp cat <<EOF >> /etc/nginx/nginx.conf rtmp { include rtmp.d/*.conf; } EOF mkdir -p /etc/nginx/rtmp.d
Now you need to know your stream keys
For Twitch that’s at https://dashboard.twitch.tv/u/your_username/settings/stream
YouTube and Kick have their own versions, check your Live settings on Youtube or Creator Dashboard on Kick.
Now we need to create a file in the newly created /etc/nginx/rtmp.d directory.
nano -w /etc/nginx/rtmp.d/restream.conf
and paste the following contents
server { listen 1935; chunk_size 4096; application live { live on; record off; on_publish http://127.0.0.1:31337/auth; push rtmp://muc01.contribute.live-video.net/app/{YOUR_TWITCH_KEY}; push rtmp://a.rtmp.youtube.com/live2/{YOUR_YOUTUBE_KEY}; push rtmp://127.0.0.1:1936/app/{YOUR_KICK_KEY}; } }
Replace your keys and save. CTRL+O to save, CTRL+X to exit.
So now we can connect to our server using rtmp on port 1935, but wait what’s this?
on_publish http://127.0.0.1:31337/auth;
That is a program to provide authentication
You can find it at https://code.icod.de/dalu/rtmpauth.
Follow the installation instructions there.
The systemd service file goes into /etc/systemd/system/rtmpauth.service .
You know the drill, nano -w /etc/systemd/system/rtmpauth.service
edit the password and CTRL+O and CTRL+X and
systemctl enable --now rtmpauth.service
Now we have password-protected our rtmp restream service.
It’s also called the stream key in OBS.
This is how you configure obs to use this, replace 1.2.3.4 with your server’s public IP address.
You can find it out writing “ip a”.
So now we have our password protected rtmp restream thingy and if you’re a desktop streamer, you’re good to go now.
Well almost, Kick is special, as it requires an encrypted rtmp connection, also called rtmps. S for secure. stunnel for secure tunnel.
In Ubuntu we install it with
apt install stunnel4 -y
nano -w /etc/stunnel/stunnel.conf
paste this
setuid = stunnel
setgid = stunnel
pid = /run/stunnel/stunnel.pid
# Some performance tunings
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
[kick]
client = yes
accept = 127.0.0.1:1936
connect = {kick stream URL without the leading rtmps://}:443
And
systemctl enable --now stunnel4.service
And now you can also stream to Kick.
As an IRL streamer you need 1 step more.
I’ll assume you already know that you can use IRL Pro on Android or Moblin on iPhone to stream with h265 encoding and the SRT protocol.
And you probably know how to control and secure your OBS installation and websocket configuration.
You probably also know how to setup your OBS scenes to receive that SRT stream.
If you don’t have scene switching set up yet, there’s 2 established software packages and I wrote a 3rd.
One is Loopy’s SRT Stats Monitor, the next is NOALBS and mine is SRT Middleware.
I wrote mine, because I wanted to learn about it and I wanted something simple without requiring a bazillion components and difficult configuration.
If it didn’t exist, I’d pick NOALBS, because it’s written in Rust and has IRC support (aka chat).
And that’s also the reason why you’d pick it anyway. However it’s more difficult to configure than my SRT middleware.
Configure the scene switcher, connect it to OBS and you’re done.
#livestreaming #obs #rtmp #rtmps #srt #restream #multistream