简体   繁体   中英

nginx rtmp proxy stream hot swapping?

I would like to setup a ngninx rtmp proxy that can forward stream from client with hotswap capability.

I'm not sure of the exact question myself, i'm not very used to rtmp, but i'll try to explain what i'm trying to achieve :

I would like to setup a twitch stream that will run non stop, even when the forwarded client stop streaming, lets assume we have multiple streamer broadcasting on the same twitch channel, when one have finished streaming, another take it place, but that require the stream to be cut for few minute.

Is there a way to setup nginx to constantly stream to that twitch channel (even when no client are streaming), and start forwarding the stream of a new streamer connecting to nginx without having to cut the twitch stream ? and if a second streamer join, can nginx automatically drop the first streamer and output the video of the second, again without dropping the twitch broadcast ?

exemple

Thanks in advance for any response !

I am not clear if you are being specific as what language or system or etc that you want this done in, but it looks like you want multiple connections to multiple locations that work two-way at (almost) the same time.

First I will give you some links to help if you need them, then I will tell you how to set up similar via a common web browser (within your system's and your browser's polling capacity).

This might help you.

Maybe if you tried to use some of the code from A Simple Webserver in C++ for Windows :https://renenyffenegger.ch/notes/web/webserver/cpp/simple/index

or

Maybe you might be looking for something like this. Media Streaming Libraries for C++ from VASTreaming : https://vastreaming.net/cpp-streaming-libraries.html

or

You might use some of this : https://www.tutorialspoint.com/cplusplus/cpp_web_programming.htm

but here is how to do similar via a common web browser.

Write a program (in VB6 sp5 I did this years ago. Never use any later version of Visual Studio for anything. In C++11 this should work.).

Using FireFox as a browser for this example.

(1) Have your program start and Subclass FireFox.

(2) Have your program tell Firefox to open up a new window (might need to make this a FireFox "new tab" or maybe not).

(3) Tell your program to get the pre-handle of the newly opening window. Do this quickly and keep trying (up to 30 seconds if you have an overloaded operating system) until you get the pre-handle, then assign a new Window's handle to that new window or new tab.

(4) Use that new handle and send a javascript to the address bar (minus the "j"), meaning that you send an entire "avascript..." to that address bar, then add the previous "j" since if FireFox detects that you placed any command into the addressbar with the entire word "javascript" it will stop you from doing some things (if I recall correctly).

(5) Run that javascript telling the page to poll your desired location for updates periodically, and to respond to updates appropriately periodically (use a timer).

(6) Just that easy. The web pages in the browser, having the javascript running in them do what you asked.

Or as a last resort:

Set up a web server at your address and directly connect to it and have it do your polling for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM