Hacker News new | ask | show | jobs
by iod 2007 days ago
Being 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

http://nginx.org/en/docs/stream/ngx_stream_core_module.html

1 comments

Thanks for sharing this information.