mediamtx icon indicating copy to clipboard operation
mediamtx copied to clipboard

Enabling/Disabling a Path

Open kapitstick opened this issue 1 year ago • 3 comments

Describe the feature

Let me know if I'm missing something, but I do not see a way to disable a path without deleting it.

The Use Case I'm thinking of is a UI that uses the HTTP API to add/remove/configure stream paths. There may be cases where you want to disable a proxied stream to save resources, but you don't want to lose all of the path information associated with it since you will enable it at a later time. And of course if you are able to disable, the feature would need to allow enabling it again. "sourceOnDemand" helps conserve resources if there are no readers, but it won't kick off active readers.

A simple addition to the configuration file like "sourceEnabled: true" or "sourceEnabled: false" would work.

kapitstick avatar May 24 '23 18:05 kapitstick

Good idea, +1.

Thanks for a great project aler9!

benbullnz avatar Aug 28 '23 04:08 benbullnz

I have a use case in retail for camera sharing where it is required to pause a stream to one application reader, reposition the camera (using PTZ) for a minute or so to look at something else for a different use case (which may start up a different stream), put the camera back and then resume the initial stream. We don't want the initial application seeing the camera move, that would freak it out. I'm even thinking redirecting the initial stream to a gstreamer test pattern or a standby video or stock camera baseline footage might work through changing the stream source. Obviously there would be a short stream outage. Some of this can already be done with streams sourcing from other internal streams. Automating this through an API is required for this solution. Potentially this could help here.

pkerney avatar Aug 30 '23 03:08 pkerney

@pkerney store the entire path configuration somewhere in the application that is controlling the server through the API, add it to the server when you need it and remove it when you don't need it anymore.

aler9 avatar Aug 31 '23 16:08 aler9