By installing an NGINX rtmp server on a Raspbian or Ubuntu SO, OBS can be linked to the server, and from the server to multiple stream platforms.
- Install NGINX and RTMP mod
sudo apt-get update sudo apt-get install nginx libnginx-mod-rtmp
- Check correct install of NGINX
sudo systemctl start nginx.service sudo systemctl status nginx.service
- Search best server based on location and get full link: https://help.twitch.tv/s/twitch-ingest-recommendation?language=en_US
- Create config to RTMP server settings:
Add following lines
sudo nano /etc/nginx/rtmp.conf
rtmp { server { listen 1935; #Default RTMP port chunk_size 4096; #Size of chunks application live { live on; record off; push rtmp://fra02.contribute.live-video.net/app/{stream_key}; #User Stream key here and link searched before } } }
- Restart NGINX service
sudo systemctl restart nginx.service
The way rtmps works with NGINX is by tunelling stream before send it to the server. You can follow these steps:
-
Modify RTMP server settings:
sudo nano /etc/nginx/rtmp.conf
Add kick line
rtmp { server { listen 1935; #Default RTMP port chunk_size 4096; #Size of chunks application live { live on; record off; #twitch push rtmp://fra02.contribute.live-video.net/app/{stream_key}; #User Stream key here #kick. port number must match on stunnel accept port push rtmp://127.0.0.1:19353/kick/{stream_key}; #User Stream key here } } }
-
Is needed to install stunnel, a SSL encryption wrapper between client and server to encrypt the transmission:
sudo apt-get install stunnel4
-
Search best server based on location and get full link: https://kick.com/dashboard/settings/stream
-
Create a config file to kick stream:
sudo nano /etc/stunnel/stunnel.conf
Add following lines:pid = /var/run/stunnel4/stunnel.pid output = /var/log/stunnel4/stunnel.log setuid = stunnel4 setgid = stunnel4 # https://www.stunnel.org/faq.html socket = r:TCP_NODELAY=1 socket = l:TCP_NODELAY=1 debug = 4 [kick] client=yes accept=127.0.0.1:19353 connect=fa723fc1b171.global-contribute.live-video.net:443
-
Restart stunnel and NGINX services:
systemctl restart stunnel4.service systemctl restart nginx.service
- On youtube account => Youtube Studio => Create => Go Live
- Select Streaming Software
- Stream Key and Stream Url are available on the Live Dashboard
- Modify RTMP server settings:
Add youtube line
sudo nano /etc/nginx/rtmp.conf
rtmp { server { listen 1935; #Default RTMP port chunk_size 4096; #Size of chunks application live { live on; record off; #twitch push rtmp://fra02.contribute.live-video.net/app/{stream_key}; #User Stream key here #kick. port number must match on stunnel accept port push rtmp://127.0.0.1:19353/kick/{stream_key}; #User Stream key here #youtube push rtmp://a.rtmp.youtube.com/live2/{stream_key}; } } }
- Restart NGINX service
sudo systemctl restart nginx.service