Open jacobevans opened 4 years ago
Try this, and then tell me how it goes.
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
push rtmp://a.rtmp.youtube.com/live2/[STREAM KEY] live=1;
record all;
record_path /recordings/live1;
record_suffix -%d-%b-%y-%T.flv;
record_lock on;
record_interval 15m;
}
application live2 {
live on;
record all;
push rtmp://a.rtmp.youtube.com/live2/[DIFFERENTKEY] live=1;
record_path /recordings/live2;
record_suffix -%d-%b-%y-%T.flv;
record_lock on;
record_interval 15m;
}
}
}
I'm trying to setup a server that can proxy two different rtmp streams, each to it's own destination. I also want to create recordings of both streams. See the config below:
I then connect one encoder to rtmp://domain/live/cam1 and the other to rtmp://domain/live2/cam2
It works for recordings. I get separate recorded flv files for each input.
However, for the output push stream, both stream keys get whichever input stream connected first. So, for example, if my
cam1
encoder connects to my nginx server a few seconds before cam2, both youtube encoders see the output of that encoder, even though I get both recordings.Am I doing something wrong here? Am I not understanding how nginx-rtmp is supposed to work?
I have tried creating two entirely separate server blocks (each on its own port), and it has the same result!
I've also tried using the
name
parameter in thepush
directive, and that doesn't seem to do anything either (though perhaps I did this wrong).