But first we need to some background music for our work

Gaming Machine (OBS Studio)

  • Stream > Stream Type: Custom streaming Sever rtmp://encodingserver:1935/live/
  • Output > Streaming
  • Encoder: H264/AVC Encoder (AMD Advanced Media Framework)
  • Preset: Reset to Default
  • Target Bitrate: 25000 (25mbps)

Gaming Machine (AMD Relive)

  • Relive > Streaming
  • Custom Stream Enabled
  • Server URL rtmp://encodingserver:1935/live/
  • Connection Key blank
  • Streaming Profile Custom
  • Streaming Resolution 1080p
  • Streaming Bitrate 20 Mbps
  • Streaming FPS 60
  • Audio Bitrate 192 kbps

Rant@AMD why cant people with non-16:9 display have a crop/pan option!
so that we can crop 1920x1200 to 1920x1080?

with ffmpeg you can do -vf "crop=1920:1080:60:60"

panning would also been nice...

Windows Encoding Server (Nginx/FFMPEG Simulcast)

Recommended Hardware for 1080p: Ryzen 1700/1600
Recommended Hardware for 720p: Ryzen 1500X

if your using a server on the intertubes please add auth or restrict by ip
http://nginx-rtmp.blogspot.no/2013/06/secure-links-in-nginx-rtmp.html
https://helping-squad.com/nginx-rtmp-secure-your-nginx-server/

  • Download: https://github.com/nwgat/ninjastreamer/archive/master.zip
  • Open conf/nginx.conf in notepad
  • Change push urls under liveout
  • Run ninjastreamer.1080p.bat for 1080p 6mbps
  • Run ninjastreamer.720p.bat for 720p 3mbps
  • in OBS Studio click start streaming
  • Run stop nginx.bat to stop nginx
  • Run kill nginx and ffmpeg.bat to taskkill if it hangs

Linux Encoding Server (Nginx/FFMPEG Simulcast)

Recommended Hardware for 1080p: Ryzen 1700/1600
Recommended Hardware for 720p: Ryzen 1500X

if your using a server on the intertubes please add auth or restrict by ip
http://nginx-rtmp.blogspot.no/2013/06/secure-links-in-nginx-rtmp.html
https://helping-squad.com/nginx-rtmp-secure-your-nginx-server/

  • sudo apt-get install ffmpeg nano git
  • git clone https://github.com/nwgat/ninjastreamer && cd ninjastreamer
  • nano conf/nginx.conf
  • Change push urls under liveout
  • chmod 777 nginx
  • chmod 777 ninjastreamer.*
  • Run sh ninjastreamer.1080p.sh for 1080p 6mbps
  • Run sh ninjastreamer.720p.sh for 720p 3mbps
  • in OBS Studio click start streaming
  • Run pkill -9 nginx && pkill -9 ffmpeg to kill if it hangs

Notes

  • Depending on your CPU you can change x264 quality with preset from ultrafast,superfast, veryfast, faster, fast, medium
  • You can even use hardware encoders like h264_amf, h264_nvenc or h264_qs

*because i was bored





  • apt-get install python-software-properties dpkg-dev git
  • add-apt-repository ppa:nginx/stable && sudo apt-get update
  • mkdir build && cd build
  • apt-get source nginx-full && cd nginx-*
  • apt-get build-dep nginx-full
  • git clone git://github.com/arut/nginx-rtmp-module.git debian/modules/nginx-rtmp-module
  • nano debian/rules
  • insert--add-module=$(MODULESDIR)/nginx-rtmp-module \ in common
  • dpkg-buildpackage -uc -b
  • dpkg -i ../nginx-common_1.10.0-0ubuntu0.16.04.4_all.deb ../nginx-full_1.10.0-0ubuntu0.16.04.4_amd64.deb

Create your own vps streaming server :)

Sample 1080p60 AVC@10Mbps AAC@192kbps

VPS (or use your own)

  • Go to digitalocean.com
  • Create a account
  • Select Size 512MB
  • Select Region closest to you
  • Select Image ubuntu 16.10 x64

Install nginx with rtmp

  • wget https://awesome.nwgat.ninja/nginx-rtmp/nginx-common_1.10.1-0ubuntu1.2_all.deb
  • wget https://awesome.nwgat.ninja/nginx-rtmp/nginx-full_1.10.1-0ubuntu1.2_amd64.deb
  • dpkg -i nginx-full_1.10.1-0ubuntu1.2_amd64.deb nginx-common_1.10.1-0ubuntu1.2_all.deb
  • apt-get install -f

or you can follow Building Nginx with rtmp support

Setting up

  • ufw allow 1935 (rtmp)
  • ufw allow 80 (dash)
  • wget https://awesome.nwgat.ninja/nginx-rtmp/rtmp.conf && cat rtmp.conf >> /etc/nginx/nginx.conf
  • wget https://awesome.nwgat.ninja/nginx-rtmp/dash.conf -O /etc/nginx/sites-enabled/dash.conf
  • rm -rf /etc/nginx/sites-enabled/default (interferes with our configs so backup if you need it

Setup Dash.js

  • cd /var/www && git clone https://github.com/arut/dash.js.git
  • cd dash.js && git checkout live
  • nano baseline.html
  • replace http://dash.edgesuite.net/envivio/dashpr/clear/Manifest.mpd with http://vpsip/dash/live.mpd
  • systemctl restart nginx && systemctl status nginx

Streaming (AMD ReLive)

there is no password or restrictions so you need to add ip whitelisting or user/password
https://helping-squad.com/nginx-rtmp-secure-your-nginx-server/

Crimson Settings > ReLive > Streaming > Custom Stream
Server URL: rtmp://vpsip:1935/live/
Connection Key: live
Streaming Profile: Custom (1080p60 @ 10Mbps/192kbps)

Notes:

  • The quality varies by scenes/games
  • AMD seems to be doing CABAC coding with 2-Pass which is nice
  • no HEVC streaming (yet) even with a custom server
  • rant: why only 10mbps max?????
  • with custom servers you can have a master stream at 25mbps and then transcode it lower on the server side

Streaming (OBS Studio)

there is no password or restrictions so you need to add ip whitelisting or user/password
https://helping-squad.com/nginx-rtmp-secure-your-nginx-server/

  • Settings > Stream > Custom Streaming Server
  • URL rtmp://vpsip:1935/live/
  • Key is live

Watching

  • you can now play rtmp://vpsip:1935/live/live in your player
  • mpv rtmp://vpsip:1935/live/live
  • vlc rtmp://vpsip:1935/live/live

or watch it on the web http://vpsip/dash.js/baseline.html

Save Stream

  • ffmpeg -i rtmp://vpsip:1935/live/live -vcodec copy -acodec copy live.mp4

Sources:

Receive $10 in credit at DigitalOcean for your VPS Hosting
€1.24 VPS from Time4VPs
Proudly published with Ghost | Theme based on Draugur | Header Image by GUWEIZ@DeviantArt
Creative Commons Licence