vMix Forums
»
General
»
General Discussion
»
vMix API Calls to other applications?
Rank: Advanced Member
Groups: Registered
Joined: 9/23/2017(UTC) Posts: 249 Location: Toronto
Thanks: 13 times Was thanked: 19 time(s) in 17 post(s)
|
Is it possible to embed API Calls to other applications with vMix? I have another application that has API through URL, and we would like to trigger it with vMix. Is this even possible through something like a script? If so, how?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/16/2015(UTC) Posts: 193 Location: Milton Keynes, UK Thanks: 10 times Was thanked: 53 time(s) in 27 post(s)
|
Yes you can do it with a simple script, and a single vMix input. I have a bunch of external stuff controlled by vMix using this method. There is no intelligence, the communication is pretty much one way, and you won't readily be able to collect or process any return activity. So here's how to do it. Add a new vMix input as a web page and call it APIcntrl, set the url to something generic, I tend to use www.google.comYou can set the resolution to whatever you like, I tend to always set it to my native project resolution. Then create a script with this in it... Code:
Function=BrowserNavigate http://api.somedevice.net/dosomthing/?key=1726354&,APIcntrl
You can make a bunch of scripts for each API function of the remote device you want to access. Give each of them a different name. Then you can assign input triggers to execute the scripts, synchronously with your transitions etc. or assign them to shortcuts and get access to them from your keyboard or 3rd part surface. If you want to do multiple API calls to one or many devices in one script, I have found you need to allow a liitle bit of 'slack' between commands, 100ms is just about enough to keep thing reliable. Code:
Function=BrowserNavigate http://api.somedevice.net/dosomthing/?apikey=1726354&command=switchon,APIcntrl
Sleep 100
Function=BrowserNavigate http://api.somedevice.net/dosomthing/?apikey=1726354&command=flyforward,APIcntrl
Sleep 100
Function=BrowserNavigate http://api.someother.com/playvt/,APIcntrl
If you need to keep multiple devices synchronous, create a vMix webpage input for each separate device (APIcntrlDrone and APIcntrlVTR) in the below example. and then you can fire commands off simultaneously from a single script without pausing between each api command. Code:
Function=BrowserNavigate http://api.somedevice.net/dosomthing/?apikey=1726354&command=switchon,APIcntrlDrone
Function=BrowserNavigate http://api.someother.com/playvt/,APIcntrlVTR
Hope this helps. Keith (Professional vMix API and Script Junkie)
|
1 user thanked kgoodyer for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/23/2017(UTC) Posts: 189 Thanks: 1 times Was thanked: 52 time(s) in 42 post(s)
|
If you already have gone the route of scripting, why use web browser input? You can make HTTP requests natively in VB.NET. This way you would not have the slack problem. Only upside of the browser version is that it is available in all versions and if your API displays response, it could be seen. Originally Posted by: kgoodyer ...simple script... vMix input as a web page
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
vMix API Calls to other applications?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close