Multi-Stream Output Modes
When using multiple input streams, file, rtsp, and rtmp sinks support two output modes controlled by the mode field:
| Mode | Behavior | Required field |
|---|---|---|
single (default) | All streams tiled into a single combined output | url or path |
multi | Each input stream produces a separate output | streams list with source_id |
With mode: "multi", the streams list must have one entry per input stream, and each source_id must match a valid input stream.
How tiling works
With multiple streams in single mode, the SDK auto-arranges inputs in a grid layout (e.g., 2 streams = 1×2, 4 streams = 2×2, 6 streams = 2×3).
Sink behavior with multiple streams
| Sink Type | single mode | multi mode |
|---|---|---|
display | Tiled grid (always) | N/A |
file | One tiled file | One file per stream |
rtsp | One tiled RTSP stream | One RTSP stream per input |
rtmp | One tiled RTMP stream | One RTMP stream per input |
kafka | All frames to one topic | N/A (includes source_id per message) |
fps | Measures overall FPS | N/A |