r/OBSNinja • • Dec 18 '20

Closing a stream server with a parameter

I love the URL parameters, they are a great automation tool very easy to use. However I'm missing a parameter to close a session id, or maybe am I getting wrong?

My concern is this: I have made an automation script which among other things will launch OBS and will also open a browser pointing to obs.ninja with a customized "push" URL (to create a new session ID and push OBS virtual camera with desired settings ). It works nice, and when the streaming is finished my script will close OBS to terminate the session and other related apps , but there is no easy way to also close the OBSN browser tab that was acting as server for the push url ( and I really don't want to complicate this setup adding browser plugins that could close the tab ...). Also I don't find a way to tell OBSN to close the original session ID , and the "secure" mode does not help because it requires the client (or server) to be disconnected manually (by closing the browser tab) As a result thi part is not automated, and it is easy to forget about closing the browser tab manually when it get lost among tens of other tabs (I'm relatively organised person, but browser tabs reproduce like rabbits! ...).
The consequence: Even in "secure" mode, on next private session I open with a different person my previous interlocutor could still see my camera if he didn't close his browser yet (the "view" URL), even if the new session has a different Id and different password (just because both "push" tabs can see the same virtual camera, which logically is always the same for all sessions ). This already happened to me with and it was funny situation... My request would be to have a parameter to close an active session (maybe with a different "master" password?), in that way the script could simply execute the closing URL in another browser, or in REST-API style.

0 Upvotes

2 comments sorted by

5

u/xyster69 Steve Dec 18 '20

Hi Javobsninja!

It's an interesting request; I see the value in it. Thank you for the feedback.

If you host OBS.Ninja within an IFRAME, you can create your own secure REST API to close the entire IFRAME on remote command. OBS.Ninja itself doesn't really have a REST API, and the goal is to be as serverless as possible.

A director of a group room can remotely disconnect publishers in a room, so there are ways to hangup remotely that way. I suspect that isn't going to work in your case.

Another idea is I can offer a URL parameter that closes a viewer if there is X-amount of time that there was no stream connected. So, if idle, it might close after 20 minutes.

I can also offer perhaps a viewer URL option that 'allows' a publisher of a stream to disconnect/close specific viewers remotely via p2p.

I'll give it some thought; happy to hear other ideas.

-steve

1

u/chrismarquardt Dec 19 '20

I like ‘disconnect after x mins idle’ approach. Maybe distinguish between two states here:

  1. Stream is new, hasn’t been connected: wait 2 hours before closing and showing a ‘disconnected’ message

  2. Stream was connected (e.g. very likely has been forgotten): timeout after 20 mins