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

Assign or clear one source slot

POST 

/api/mediasrc/assign

Assigns a media-library path to one one-based source slot. Send an empty file value to clear the slot. Insight probes the media, normalizes the requested transport to one supported by the detected codec, persists the assignment, and automatically restarts the source when it was already playing. Obtain valid paths from /api/mediasrc/videos.

Assigning a file to a webcam slot converts it back to a file source, so Insight first asks MediaMTX to close the browser publishing to it. If MediaMTX cannot be reached the call answers 502 and leaves the slot unchanged, because converting it would erase the only record that a camera may still be publishing. A caller that already closed its own publisher may send publisher_released: true.

Request​

Responses​

Operation completed.