*Skip to the bottom for OBS Setup
Used to allow the LinusTechTips team to stream to both YouTube and Twitch at the same time :D
Important Notes:
- It's not really designed for randoms to be able to setup, but if you somewhat know your way around Linux you should be able to, no issue.
- Stats page: http://10.20.0.70:8080/stats
- Recording directory (on transcode server): /mnt/recording
- If the ingest FPS is different than the output (which defaults to 30 fps), it can cause dropped frames on the streaming rig
Designed for ubunutu 18.04
This assumes you are working in the /home/linus directory. If otherwise you will need to change the config in step 9 to reflect that, otherwise the stats page will not work. This also assumes you are using a non-root user named "linus". Please use a non-root user. :P
pre-setup: Set your network card's IP - we are using 10.20.0.70 as the static IP for the streaming server. Note, there are a LOT of places that the IP will need to be changed inside nginx.conf to get this working with a different IP address.
-
Install dependencies
sudo apt install build-essential libpcre3 libpcre3-dev libssl-dev zlib1g-dev ffmpeg -y
-
Make and enter "build" directory
mkdir build && cd build
-
Download newest NGINX "stable" release (right click, copy, then wget from here: http://nginx.org/en/download.html)
wget http://nginx.org/download/nginx-1.14.0.tar.gz
-
clone the NGINX RTMP module from github
git clone git://github.com/arut/nginx-rtmp-module.git
-
Extract the NGINX tarball, and then enter the directory
tar xzf nginx-1.14.0.tar.gz && cd nginx-1.14.0
-
Build NGINX w/ the RTMP module
sudo ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module
sudo make
sudo make install
-
Start NGINX
sudo /usr/local/nginx/sbin/nginx
-
Set NGINX to start on boot
sudo bash -c "curl https://raw.githubusercontent.com/tivyhosting/multistream/master/nginx > /etc/init.d/nginx"
sudo chmod +x /etc/init.d/nginx
sudo update-rc.d -f nginx defaults
sudo systemctl enable nginx
-
Configure NGINX w/ RTMP config (you will need to edit streamkeys/settings probably)
sudo rm -rf /usr/local/nginx/conf/nginx.conf
sudo bash -c "curl https://raw.githubusercontent.com/tivyhosting/multistream/master/nginx.conf > /usr/local/nginx/conf/nginx.conf"
-
Set your desired stream keys in the nginx.conf config file (the defaults are empty)
- Replace "TWITCH_STREAM_KEY" with your twitch stream key, and "YOUTUBE_STREAM_KEY" with your youtube stream key.
sudo nano /usr/local/nginx/conf/nginx.conf
- Replace "TWITCH_STREAM_KEY" with your twitch stream key, and "YOUTUBE_STREAM_KEY" with your youtube stream key.
-
Also set your desired storage location for the live recording off the input stream (please note this directory MUST be set to 777 permissions as NGINX uses a no-perm user to run it's workers)
- Replace "/home/linus/recordings" with your desired recording location
sudo nano /usr/local/nginx/conf/nginx.conf
- Replace "/home/linus/recordings" with your desired recording location
-
Restart NGINX
sudo service nginx restart
-
You should now be able to stream to the NGINX server. We have 3 distinct ingest servers for the 3 different intended streaming setups.
- Streaming to both YouTube and Twitch:
rtmp://10.20.0.70:1935/transcode-yt-twitch
- Streaming to just YouTube:
rtmp://10.20.0.70:1935/transcode-yt
- (Streaming to both YouTube and Floatplane:
rtmp://10.20.0.70:1935/transcode-yt-fp
(NOT YET WORKING))
- Streaming to both YouTube and Twitch: