5 ms·
I have had good experiences with the free NGINX RTMP Module¹ for basically doing the same thing. I just have a cheap US and EU cloud instance. Stream OBS in mul
by iod 6y ago
I have had good experiences with the free NGINX RTMP Module¹ for basically doing the same thing. I just have a cheap US and EU cloud instance. Stream OBS in multiple qualities to the US endpoint and have it auto pushed to the EU endpoint. Using this module, both endpoints use RTMPS and generate HLS and DASH. Then added a little HLS.js² player and can easily serve a small private viewing party, at multiple stream qualities with auto quality/bandwidth adjustment.
¹ https://github.com/arut/nginx-rtmp-module https://github.com/arut/nginx-rtmp-module
² https://hls-js.netlify.app/demo https://hls-js.netlify.app/demo
- famoreira 6y agoThis sounds interesting. Do you have pointers to any resources/tutorial to setup something similar to what you have?
- iod 6y agoBeing already familiar with NGINX, I found the examples in the docs¹/docs-wiki³ relatively sufficient. If you care about adaptive HLS streaming, make sure to add "hls_variant" directives for each quality level such as: hls_variant _1080p BANDWIDTH=10485760,RESOLUTION=1920x1080; on the OBS/source side you want to match stream names like: rtmp(s)://your-nginx-server/your-publish-endpoint/your-stream_1080p If you care about RTMPS (with TLS), you will want to look at NGINX Stream Core module⁴, with a server "listen" directive with the "ssl" option and a "proxy_pass" to the RTMP endpoint. For sending RTMPS from RTMP you will need another server "listen" with no "ssl" option and "proxy_ssl on", since the module has no native RTMPS capabilities, in order to get RTMPS as both server and sending client. For RTMP auto-publishing to multiple servers, you will want the "push" directive, and don't forget to give it a "name=" option, or it will grump. I struggled to get the "pull" directives to always work consistently and quickly. If you want lower latency, make sure your source stream has small keyframe periods and that they match "buflen" directive; I opt for 2 seconds. But if using HLS, there isn't that much more you can do on that front. ³ https://github.com/arut/nginx-rtmp-module/wiki/Directives https://github.com/arut/nginx-rtmp-module/wiki/Directives ⁴ http://nginx.org/en/docs/stream/ngx_stream_core_module.html http://nginx.org/en/docs/stream/ngx_stream_core_module.html
- dontbesquare 6y agoThanks for sharing this information.
- me551ah 6y ago+1. I've used nginx multiple times for this and it works really well. I was once working for a company and evaluated multiple softwares for live streaming and nginx even beat some of the paid offerings. These days I just use YouTube/Facebook to stream to private audiences. For personal streams that works really well. These are also better platforms for online casting since they provide much better discoverability compared to owncast instances.
- remram 6y agoThere is an open-source platform built on nginx-rtmp (and Python/Django): https://openstreamingplatform.com/ https://openstreamingplatform.com/ The other open-source alternative I know is PeerTube, which is getting live-streaming support in 3.0 (currently release candidate).