Nginx-RTMP is an Nginx module that can be used as a media streaming server for both live streams and video on demand using RTMP , you can use it as a restreamer to stream to multiple RMTP services(YouTube, Twitch, etc…):
sudo snap install nginx-rtmp --beta --devmode
You have three commands:
Start the server
snap run nginx-rtmp.start
Stop the server
snap run nginx-rtmp.stop
Reload the nginx conf file
snap run nginx-rtmp.reload
RTMP Settings:
rtmp://YOUR_IP:1935/live
Stats:
http://YOUR_IP:9090/stat.xsl
You’ll see a blank page here(xsl/xlt issue) but you can view the source of the web page to get them.
To start streamig you can use OBS or ffmpeg like this :
ffmpeg -i "video.mp4" -deinterlace -vcodec libx264 -pix_fmt yuv420p -preset medium -r 25 -g $((25 * 2)) -b:v 2500k -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k -f flv rtmp://127.0.0.1:1935/live
The conf file can be found here:
$SNAP_USER_DATA/nginx.conf