HTTP WEB API
The vMix API provides access to common functions through the HTTP protocol.
For example, the following command will signal vMix to fade Preview to Active within 1 second:
http://127.0.0.1:8088/api/?Function=Fade&Duration=1000 |
Setup
The API uses the same web address as the standard Web Interface and can be configured from the Web tab in Settings.
Parameters
Function
Specify a function to execute.
This can be any of the functions provided for the Shortcuts feature.
To view a list of what is possible, in vMix go to Settings, Shortcuts and click Add.
All the functions in the "Function" dropdown box can be called from the API.
Click here to view a list of some of the Shortcut Functions that are available.
Duration
If the specified function is a transition this parameter can be set to a time in milliseconds.
Input
Input can be used to specify the Input in one of three ways:
1. By number starting from 1.
0 can be used for Preview and -1 for Active.
2. By name. (note that it is case sensitive, and requires the full title name including spaces)
3. A GUID can be used to specify an exact input. The GUID can be found from the "Key" attribute in the XML.
For example:
http://127.0.0.1:8088/API/?Function=Fade&Duration=1000&Input=877bb3e7-58bd-46a1-85ce-0d673aec6bf5
SelectedName
When using Title or XAML inputs, SelectedName can be used to specify the name of the text field to modify.
For example:
http://127.0.0.1:8088/API/?Function=SetText&Input=877bb3e7-58bd-46a1-85ce-0d673aec6bf5&SelectedName=Headline&Value=Hello
When using GT titles, the name should include ".Text" at the end for text fields and ".Source" at the end for images or rectangles with brush images.
For reference, these full names are displayed in the Title Editor built into vMix.
For example:
http://127.0.0.1:8088/API/?Function=SetText&Input=877bb3e7-58bd-46a1-85ce-0d673aec6bf5&SelectedName=Headline.Text&Value=Hello
http://127.0.0.1:8088/API/?Function=SetImage&Input=877bb3e7-58bd-46a1-85ce-0d673aec6bf5&SelectedName=MyImage.Source&Value=filename.jpg
SelectedIndex
Specify an index to pass to the input
The following Inputs support the SelectedIndex parameter:
VideoList: Specify the video to play starting from 1
Virtual Set: Specify the camera zoom to transition to
Title: Specify the text item to configure starting from 0
Value
Value is used with many different API Functions including the following.
For a full list of functions that use Value parameters refer to the Shortcut Function Reference.
SetImage: Specify the image to display in an image field within a supported XAML or Title input
SetText: Specify the text to display in the text field specified by SelectedIndex above.
SetPosition: In milliseconds
SetCountdown: As a timespan (00:00:00)
SetFader: As a number between 0 and 255
AddInput: Specify the Video/Image/Photos or Xaml input filename in the following formats:
Video|c:\filename.wmv
Image|c:\filename.jpg
...
Mix
In the 4K and Pro editions up to three separate Mix inputs are available.
This parameter can be used to select the Mix to use where 0 = main mix, 1 = first Mix input, 2 = second Mix input etc.
Channel
Some replay functions can be applied to a specific channel. If this parameter is left blank it will default to the currently selected channel in the Replay user interface.
The value should be A, B, Current or left blank.
Return
If successful, the API will return the standard 200 response code.
If an error occurs, the API will return the standard 500 error code.
Information
If all parameters are left blank the API will return state information in XML format.
The following is an example of the XML output:
<vmix>
<version>11.0.0.16</version>
<inputs>
<input key="26cae087-b7b6-4d45-98e4-de03ab4feb6b" number="1" type="Xaml" title="NewsHD.xaml" state="Paused" position="0" duration="0" muted="True" loop="False" selectedIndex="0">
NewsHD.xaml
<text index="0" name="Headline">Hello</text>
<text index="1" name="Description">Hello</text>
</input>
<input key="55cbe357-a801-4d54-8ff2-08ee68766fae" number="2" type="VirtualSet" title="LateNightNews" state="Paused" position="0" duration="0" muted="True" loop="False" selectedIndex="0">
LateNightNews
<overlay index="0" key="2fe8ff9d-e400-4504-85ab-df7c17a1edd4"/>
<overlay index="1" key="20e4ee9a-05cc-4f58-bb69-cd179e1c1958"/>
<overlay index="2" key="94b88db0-c5cd-49d8-98a2-27d83d4bf3fe"/>
</input>
</inputs>
<overlays>
<overlay number="1"/>
<overlay number="2">1</overlay>
<overlay number="3"/>
<overlay number="4"/>
<overlay number="5"/>
<overlay number="6"/>
</overlays>
<preview>1</preview>
<active>2</active>
<fadeToBlack>False</fadeToBlack>
<transitions>
<transition number="1" effect="Fade" duration="500"/>
<transition number="2" effect="Wipe" duration="500"/>
<transition number="3" effect="Fly" duration="500"/>
<transition number="4" effect="CubeZoom" duration="3000"/>
</transitions>
<recording>False</recording>
<external>False</external>
<streaming>False</streaming>
<playList>False</playList>
<multiCorder>False</multiCorder>
</vmix>
In the example above Input 2 is active and Input 1 is currently running as Overlay 2.