Nginx RTMP variables for push

2

1

Im trying to setup a nginx server to push an incoming stream to different streaming platforms for me and some friends. the problem to this is, that one of these platforms changes streamkey on every stream, or sometimes they want to regenerate their streamkeys.

So i need a way to change the push rtmp:// target in the nginx.conf while the nginx is running. nginx -s reload and kill -HUP PID dont work. i extensively tested it and it wont push to a new target, only restarting the nginx with -s stop & nginx made it load the new config.

so my idea was to pass variables into the application block of the nginx with every stream like this:

application friend1 {
live on;
record off;

push rtmp://live.twitchurl.tv/app/$argument_passed;
push rtmp://some.otherservice.com/live/$argument2;
}

application friend2 {
live on;
record off;

push rtmp://live.twitchurl.tv/app/$argument_passed;
push rtmp://some.otherservice.com/live/$argument2;

}

and so on, then they stream to http://myservice.com/friend1?argument_passed=key1&argument2=key2, or anything like that. After 2 days of permanent googling and reading every entry on at least 3 pages(per search term) im realy desperate for an answer.

I chose nginx because its lightweight and i dont have a powerfull server, but im absolutely willing to use any other rtmp to achieve this.

Server runs on Ubuntu, nginx version is 1.15.2.

Any ideas how to solve this?

c0wtschpotato

Posted 2018-09-15T12:19:48.073

Reputation: 21

No answers