Skip to content

feat: support multiple src= parameters to create multi-source streams#2179

Open
gudaja wants to merge 1 commit intoAlexxIT:masterfrom
gudaja:ws_multi_source
Open

feat: support multiple src= parameters to create multi-source streams#2179
gudaja wants to merge 1 commit intoAlexxIT:masterfrom
gudaja:ws_multi_source

Conversation

@gudaja
Copy link
Copy Markdown
Contributor

@gudaja gudaja commented Mar 25, 2026

Summary

Currently, GetOrPatch only accepts a single src query parameter. This PR extends it to accept multiple src parameters, allowing a stream to be created with several producers at once.

Changes

  • GetOrPatch now reads all src values from the query string instead of just the first one
  • When more than one src is provided, a new multi-source stream is created using all of them as producers
  • An optional name parameter can be used to name the stream; if omitted, the first src value is used as the name
  • If a stream with that name already exists, it is returned as-is (idempotent)
  • Single-source behavior is unchanged

Usage

GET /api/stream?src=rtsp://admin:admin@192.168.1.1/stream0&src=rtsp://admin:admin@192.168.1.1/stream1&name=my-multi-cam

This creates a stream named my-multi-cam backed by two producers: rtsp://cam1 and rtsp://cam2.

Motivation

Some setups require combining multiple video sources into a single logical stream (e.g. redundant cameras, multi-angle feeds). Previously this required manual configuration in go2rtc.yaml. With this change it can be done dynamically via the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant