deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.18k stars 284 forks source link

Feature Request: API to get client info #73

Open Bhlowe opened 2 years ago

Bhlowe commented 2 years ago

I'd like to be able to use the API to find out info about clients watching each stream. I am in the process of implementing this in my fork.. but wanted to see if you had any input.

API Addition:

/clients (all clients)  

payload for each client viewing a channel would be id (client id), stream (stream id), channel (channel), mode (MSE, WEBRTC,RTSP)

And ability to end a user's stream nicely. (Maybe already in the code?)

/client/delete/{client_id} 

Also would be nice if we can see each channel is actively receiving RTSP or not and how many clients are watching a stream.

on GET /stream/{STREAM_ID}/info

Add items to each channel payload: add active:boolean to show if actively receiving rtsp [ I think this is "status", so already implemented. ] add clients:int to show how many clients are watching stream. add error:string to show error if problem with rtsp stream.

Want to see what you think... Love the project.. Streaming server has great low-latency and handles video really nicely. I'm a java dev, but happy to attempt a patch.. or pay you for a little code review. (Not using your app commercially yet, but want to start testing it for PTZ webcam broadcasting.)

deepch commented 2 years ago

Perhaps when I have time I will do this method.

h-ludwig commented 1 month ago

Just being able to get the number of viewers per stream would be sufficient for my purposes.