Stop one source
POST/api/mediasrc/stop
Stops the process backing one source slot and persists its state as stopped without clearing the assigned file. The same slot can subsequently be started again without reassignment.
A webcam slot is published by a browser rather than by Insight, so stopping one asks MediaMTX to close that session. If MediaMTX cannot be reached the call answers 502 rather than reporting a stop it cannot verify. A caller that has already closed its own publisher may send publisher_released: true with the publisher_session it closed; Insight then verifies that session still holds the slot rather than kicking anything (a different session answers 409, an unreachable MediaMTX 502, changing nothing either way).
Request
Responses
- 200
- 400
- 404
- 409
- 502
Operation completed.
Missing or invalid request data.
The requested resource was not found.
Nothing was changed, for one of two reasons: the released session no longer publishes to this slot and a different session does; or the slot changed kind (file to webcam or back) while this request was waiting on MediaMTX. Reload the source list and retry.
Insight could not reach MediaMTX to verify the slot's publisher, so nothing was changed. If the camera has in fact stopped, the slot updates on its own once MediaMTX is reachable.