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. Returns 409 when an external publisher holds the slot and Insight has no stream of its own on it; use /api/mediasrc/takeover first. Stopping a pulled slot releases the pull and restores the stored file assignment.
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: an external publisher holds the slot and Insight has no stream of its own on it (use /api/mediasrc/takeover first); or, for a webcam slot, the released session no longer publishes to it or the slot changed kind while this request was waiting on MediaMTX (reload the source list and retry).
Nothing was changed: MediaMTX could not be reached to verify a webcam slot's publisher, or could not be told to stop pulling into the slot (the slot stays pulled so Stop can be retried).