It looks like simulcasting a single users RTMP stream is as simple as creating an RTMP server configuration in my nginx.conf file and using the push directive to push the stream to the different Social Media RTMP url, but what would be the best way to do this if I have multiple users needing to stream their data to their own social media live accounts?
Here are the possible solution that I can think of:
Use docker to create multiple containers with Nginx RTMP installed for each individual who signs up. I could then edit & manage separate RTMP server configurations and reload the configuration so they can each begin streaming. This sounds like a lot of overhead though.
If it's possible, I could setup multiple RTMP server configs for each user in a single environment (sites-enabled) and reload the config without NGINX going down, but using different ports doesn't seem ideal and I feel like if something happens while the server is reloading the config there is a possibility of every individual who is streaming dropping their connection. Edit: Sites enabled seems out of the question since it needs to be within root context (nginx.conf only) as per https://github.com/arut/nginx-rtmp-module/issues/1492
Map to each users RTMP push directives using their stream key and then forward to that users social media?
Any thoughts?
Here's my example single server configuration:
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
push rtmp://facebook/STREAM KEY HERE;
push rtmp://youtube/STREAM KEY HERE;
}
}
}
I'm new to RTMP if you haven't picked that up yet :P
Check out the following project on Github, it does exactly what you need: