arut / nginx-rtmp-module

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

Forward RTMP to another server based on stream key #1643

Open clime opened 2 years ago

clime commented 2 years ago

Hello,

I would like to do a setup like the following:

In addition the whole setup should be dynamic, i.e. I would like to access DB (or a file) to fetch target machine URL for a particular stream key.

Is it possible (e.g. by combining this module and lua module or by some other way...)?

lassos commented 2 years ago

Would be really nice to know plan the same way to push dynamically with different streaming keys

georgeinggs commented 2 years ago

I would also love something like this feature. I have tried for months to find out how large streaming companies like YouTube offer a single public ingest URL and route (load balance? proxy? restream?) incoming streams via their Stream Key.

dromer commented 2 years ago

Would love to have lua scripting capabilities inside the rtmp endpoints, like openresty does for http. To then dynamically construct exec lines for ffmpeg threads.

There is a work-around by using on_publish with a dynamic endpoint (I build with openresty to then use lapis and build my business logic application). Using https://github.com/musclewizard/nginx-rtmp-module/commit/0f24f6def1f20d1964a4b24bd05b56ff5e99eb61 you can have the callback send to several push targets with different setups.

dcarrion87 commented 7 months ago

Stuck on this too. My issue is always hitting "already publishing" error when trying multiple streams down the one application. Not sure how to differentiate them using this module.