Skip to content

Video Switcher

Martin Pulec edited this page Jan 3, 2024 · 7 revisions

Basic usage

UltraGrid

If you have multiple video sources you want to switch between during transmission, you can use video switcher dummy video driver, syntax is following:

uv -t switcher -t decklink:0 -t decklink:1

Note: the order of -t arguments is important, first must be "switcher", consequent capture parameters give the switcher possible inputs that can be switched to. It is usually a good point to have the same video format from all sources, although not required.

Control

Switching registers interactive control via keyboard control, it means that it is sufficient to press 1, 2 .. n for first to n-th input in terminal in which UltraGrid is run.

Alternatively, it can be controlled via a control socket, eg:

echo 'capture.data 0' | busybox nc localhost <control_port>

Note: There is a difference between indices over control port and keyboard. First is 0-indexed, keyboard control uses 1-indexed keys, so first input has key "1" but index "0". The shift for keyboard control is to have the inputs on the keyboard physically next each other.

Note 2: netcat from busybox is used because it has defined behavior (other implementation may also need '-N' to close connection after processing the command).

Capture filters

You may also apply capture filters for individual inputs:

uv -t switcher --capture-filter blank:0:0:100:100 -t testcard --capture-filter 1000:0:80:100 decklink

Here --capture-filter parameter relates directly to nearest succeeding -t parameter.

Audio

Similarly to capture filters above, you can specify audio connections for individual video captures by setting the option before respective vidcap. If specified before the switcher, it applies to all inputs (that doesn't set the connection explicitly).

Examples:

  1. uv -t switcher -s embedded -t testcard -s analog -t decklink -t aja

    testcard will use embedded audio connection, decklink analog; AJA none

  2. uv -s embedded -t switcher -t testcard -s analog -t decklink -t aja

    sets embedded for both aja and testcard (embedded specified before "switcher"), decklink is explicitly set to analog

  3. uv -t switcher -t testcard -t decklink -t aja -s portaudio

    send PortAudio (position of the argument doesn't matter in this case), no switching takes place

  4. uv -t testcard -t decklink -s embedded -t aja -s portaudio

    uv -t testcard -t decklink -s alsa -t aja -s portaudio

    doesn't work (more audio devices or audio device + audio connection is not supported, only multiple video-attached audio connections can be given)

Clone this wiki locally