====== NGINX - Videostreaming ====== work in progress Nginx comes with a RTMP Plugin, which can be configured to play stream HLS, RTMP and DASH. The Setup is a bit tricky and working values for Bitrate, etc are hard to find. ====== Basic Installation ====== .. in Debian Buster is easy apt install nginx nginx-rtmp-module Links: * https://www.hostwinds.com/guide/live-streaming-from-a-vps-with-nginx-rtmp/ * https://gist.github.com/pschichtel/31fc635174bac1bc1a7c * https://gerpei.de/eigener-live-streaming-server-setup/ ====== Security ====== .. is not so easy. 1. Level is to allow only some IPs to publish streams via deny / allow settings in nginx 2. Level is to add a Stream Key. This does not work for me yet in OBStudio 3. .. Links: * https://blog.peer5.com/practical-approaches-for-securing-your-video-streams/ * https://gist.github.com/mrbar42/09c149059f72da2f09e652d4c5079919 * https://smartshitter.com/musings/2017/12/nginx-rtmp-streaming-with-simple-authentication/ * https://smartshitter.com/musings/2018/06/nginx-rtmp-streaming-with-slightly-improved-authentication/ ====== Server Side Stream Switching ====== Should be possible, found a workinf version here (see supllex server): * https://github.com/arut/nginx-rtmp-module/wiki/Control-module * https://nginx-rtmp.blogspot.com/2014/01/redirecting-streams-in-version-111.html * https://groups.google.com/g/nginx-rtmp/c/yUcTKB9pAl0 ====== Stream twitch to RTMP Server ====== streamlink https://www.twitch.tv/videos/123123123 best -O | ffmpeg -i pipe:0 -c copy -f flv rtmp://xxxxx/foo/stream-A