arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.46k stars 3.51k forks source link

Multiple servers or applications? #1580

Open ChristofferSthlm opened 3 years ago

ChristofferSthlm commented 3 years ago

Throwing out a question here:

Is it possible to have multiple rtmp servers or applications to make the streaming workflow easier? I have the need to re-stream to different groups of multiple locations for different organisations. It would be so easy to just call the servers or applications when I switch between the organisations instead of having to rewrite the code in the nginx.conf all the time. :)

Something like:

 #push RTMP stream set 1 for organisation 1
server {
    listen 1935;
    application myapp1 {
    push rtmp://example1a
    push rtmp://example 1b 

    }
}
 #push RTMP stream set 2 for organisation 2
server {
    listen 1935;
    application myapp2 {
    push rtmp://example2a
    push rtmp://example 2b 

    }
}

Any wisdom on this?

cmnajs commented 3 years ago

You can create multiple apps inside same server block

rtmp {
  server {
    listen 1935;
    listen [::]:1935 ipv6only=on;

    application myapp1 {
        live on;
    }
    application myapp2 {
        live on;
    }
  }
}
Newt6611 commented 2 years ago

@cmnajs hi what if i have 2 application, and then i want to make it dynamic like below, how can i set streamKey from http callback

rtmp {
  server {
    listen 1935;
    listen [::]:1935 ipv6only=on;

    application facebook{
        live on;
        push http://facebook/{streamKey}
    }
    application youtube {
        live on;
        push http://youtube/{streamKey}
    }
  }
}
yakupbeyoglu commented 1 year ago

Hi @cmnajs , is it possible to add an application dynamically without restarting the Nginx?

what if i have 2 application, and then i want to make it dynamic like below, how can i set streamKey from http callback

Hi @Newt6611, did you find any solution?

knvchaitanya1990 commented 1 year ago

@Newt6611 - Did you get the answer ? Please let me know I am also looking for the similar solution .