voc / srtrelay

SRT relay server for distributing media streams to multiple clients.
MIT License
144 stars 36 forks source link

add an on_publish_done directive #12

Open parkervcp opened 3 years ago

parkervcp commented 3 years ago

To match the on_publish support it would be good to also send done messages. This would also match rtmp and would be a way to tag a stream as offline.

nginx-rtmp docs https://github.com/arut/nginx-rtmp-module/wiki/Directives#on_publish_done

iSchluff commented 3 years ago

I think the API is a bit problematic because it doesn't allow you to reliably know whether a stream is active or not. If either the relay or the api endpoint is restarted you can't really track the state anymore. It may be convenient but it's not really a good solution to the problem.

I think a better solution would be to poll the srtrelay api or nginx-rtmp api for that matter to see the currently active streams.

parkervcp commented 3 years ago

We are already using the api to get active streams but the same page we have for auth also tracks "live" status. It's something we had and I noticed all the keys that were authenticated showed as live. Looking at the nginx rtmp options I saw we were using the done directive.