Перейти до основного вмісту

Stop every source

POST 

/api/mediasrc/stop-all

Stops all running source processes while preserving their file assignments and transport choices. Use this before deleting media, changing a group of assignments, or shutting down a test; the response reports how many sources were previously playing. The external stream on a slot held by an external publisher is left running and the slot is listed in skipped_external. A network stream Insight pulls into a slot is stopped like a file source: the slot returns to its previous file assignment and is listed in stopped_pulled, and counts toward stopped_count. A pull still being set up, or one MediaMTX did not confirm cleared, keeps running and is listed in skipped_pulled; stop it again later.

Webcam slots are published by a browser rather than by Insight, so stopping one asks MediaMTX to close the session. Any slot whose publisher could not be confirmed closed is listed in unconfirmed_webcams; the other sources still stop. A slot reassigned by another caller while this request was releasing publishers is left as it now is and listed in changed_sources. A caller that has already closed its own publishers may name them in released_webcams as {index, session} objects; a bare index is not a claim and that slot is stopped the normal way. A named session is honoured only if it still holds the slot, so a claim MediaMTX cannot confirm is still listed in unconfirmed_webcams.

Request​

Responses​

Number of sources that were previously playing.