Fade a vMix preview over the HTTP API

TL;DR. vMix fades Preview to Active with Function=Fade and Duration=1000 on port 8088. Input 0 is Preview. A blank request returns XML, and success is HTTP 200.

This is a commercial product. AgentOnStage isn't paid for this listing.

Commercial productLED/VideoBeginnervMixHTTP

What it does

The vMix User Guide's HTTP Web API page says the API reaches common functions over HTTP. The worked command fades Preview to Active in one second:

http://127.0.0.1:8088/api/?Function=Fade&Duration=1000

The API uses the same address as the Web Interface. That address is set on the Web tab in Settings. Function is any function from the Shortcuts feature. The page says to open Settings, Shortcuts, and Add, and that every name in the Function dropdown can be called from the API. The Shortcut Function Reference says those functions can be called from a shortcut or from the API, and that transition names such as Fade, Zoom, and Cut match the names in the vMix interface. They are in addition to the named functions in that reference.

Duration is the transition time in milliseconds, and only when the function is a transition. Input picks an input in one of three ways. A number starts at 1. 0 is Preview and -1 is Active. A name is the full title, including spaces, and it is case sensitive. A GUID is the Key attribute in the XML state. The page's GUID example is:

http://127.0.0.1:8088/API/?Function=Fade&Duration=1000&Input=877bb3e7-58bd-46a1-85ce-0d673aec6bf5

SelectedName names a text field on a Title or XAML input. The example sets Headline to Hello with Function=SetText on that same GUID. On a GT title the page says the field name ends in .Text, and an image or a rectangle with a brush image ends in .Source. Those full names are the ones shown in the Title Editor. The image example is SelectedName=MyImage.Source and Value=filename.jpg with Function=SetImage.

SelectedIndex is accepted by three input types. On a VideoList it is the video to play, starting at 1. On a Virtual Set it is the camera zoom to transition to. On a Title it is the text item, starting at 0. Value changes meaning with the function. SetPosition is milliseconds. SetCountdown is a timespan written 00:00:00. SetFader is a number from 0 to 255. AddInput takes a filename in the form Video|c:\filename.wmv or Image|c:\filename.jpg.

Mix selects which mix a function uses. The page says the 4K and Pro editions have up to three separate Mix inputs. 0 is the main mix, 1 is the first Mix input, and 2 is the second. Overlay and Stinger shortcuts can name more than one mix in a comma-separated list. Mix=0,1 puts the overlay or stinger on the main mix and the first Mix input. Channel applies to some replay functions. Left blank, it is the channel selected in the Replay interface. The value is A, B, Current, or blank.

A successful call returns HTTP 200. An error returns HTTP 500. A request with every parameter left blank returns the state as XML. The sample document is a <vmix> tree whose <version> is 11.0.0.16. Input 1 is a Xaml title NewsHD.xaml with text fields Headline and Description. Input 2 is a VirtualSet titled LateNightNews. <preview> is 1 and <active> is 2. Overlay number 2 contains 1. The page says that example has Input 2 active and Input 1 running as Overlay 2. <fadeToBlack> is False. The four <transition> rows are Fade at 500 ms, Wipe at 500 ms, Fly at 500 ms, and CubeZoom at 3000 ms. <recording>, <external>, <streaming>, <playList>, and <multiCorder> are each False.

Control vMix live production from an MCP client is an assistant in front of the same Web Controller. This page is the HTTP URL that controller calls.

How to set it up

  1. In vMix, open Settings and the Web tab, and confirm the Web Interface address. The API page's example is http://127.0.0.1:8088/api/.
  2. Request that address with no query. The page says a request with every parameter blank returns XML. Read <preview>, <active>, and each input's number, title, and key before you send a function.
  3. Fade Preview to Active with Function=Fade and Duration=1000. The page says that duration is one second, in milliseconds. Expect HTTP 200. HTTP 500 is the error code the page names.
  4. Fade a specific input by adding Input. Use its number from 1, the full title with spaces and the same case, or the key GUID. Input=0 is Preview and Input=-1 is Active.
  5. For a title, copy the field name from the Title Editor. A GT text field ends in .Text. Function=SetText with SelectedName and Value is the page's example. SetFader uses Value from 0 to 255. On a 4K or Pro edition, Mix=0 is the main mix.

Source: vMix HTTP Web API and Shortcut Function Reference.

FAQ

Does a blank URL run a cut?

The page says a request with every parameter left blank returns the state XML. The fade URL is Function=Fade and Duration=1000. The shortcut reference says Cut is one of the transition names, alongside Fade and Zoom, and that those names match the interface.

Which input number is the program bus?

The page says numbers start at 1, 0 is Preview, and -1 is Active. In the sample XML, <active> is 2 and <preview> is 1. A title is matched by the full title string, and the page says that string is case sensitive.

What does HTTP 500 mean?

The page says a successful call returns 200 and an error returns 500. It does not print a response body for the 500. The XML state document is the reply when the query is empty.

Also on this rig

Original source: https://www.vmix.com/help30/DeveloperAPI.html

AI on Stage, a weekly newsletter

New agent use cases for live events, once a week.