logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

23 Pages«<212223
Options
Go to last post Go to first unread
Roy Sinclair  
#441 Posted : Friday, June 30, 2023 1:45:01 PM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 106
United States
Location: Wichita

Thanks: 8 times
Was thanked: 18 time(s) in 14 post(s)
Originally Posted by: gpdipalmerahtimur Go to Quoted Post
Hi Doggy,

If we can modify a Title Fill Color by using SetColor, can we also use script to Change Border Color dynamically?


Nope. They added the new feature of colored borders but they never added it to the API. You need to request it as
"Feature Request" though they really should be considering the API whenever they add a new feature at this point they are not doing so.
engelschall  
#442 Posted : Saturday, July 1, 2023 7:38:39 PM(UTC)
engelschall

Rank: Advanced Member

Groups: Registered
Joined: 3/7/2022(UTC)
Posts: 71
Germany
Location: Munich

Was thanked: 32 time(s) in 17 post(s)
Just a hint for all those struggling with scripting vMix and want a resource for "borrowing" code snippets:

During the last 1.5 years, in the context of our company filmstudio and its live event productions, I've developed multiple production-grade vMix scripts and released them as Open Source Software. Recently, I've further polished and documented all the scripts, added a few new ones and improved some of the existing ones. Check out this freely available vMix Scripts collection now, feel free to reuse some of those scripts in your own productions, and please give back some feedback. I hope this resource is useful for all professional vMix users.
thanks 6 users thanked engelschall for this useful post.
nikosman88 on 7/1/2023(UTC), doggy on 7/1/2023(UTC), dmwkr on 7/10/2023(UTC), Bonbondotkom on 7/28/2023(UTC), Simsyuk on 9/17/2023(UTC), avsoundguy on 9/28/2023(UTC)
doggy  
#443 Posted : Sunday, July 9, 2023 10:22:49 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,764
Belgium
Location: Belgium

Thanks: 268 times
Was thanked: 868 time(s) in 711 post(s)
Total Seconds Countdown not as standard timedisplay

Code:
'Total Seconds Countdown using Stopwatch as time reference

dim total as integer = 250  'Total # of seconds to count down
dim label as integer = 1
dim watch As Stopwatch = Stopwatch.StartNew()

do while label > 0  
     
     Dim elapsed As TimeSpan = watch.Elapsed
     label = total - Math.Floor(elapsed.TotalMilliseconds/1000)
     API.Function("SetText",Input:="9",SelectedName:="Description.Text",Value:=label) 'edit for own titlinput
     Sleep(250)
loop


Code:
'Total Seconds Countdown using DateTime as time reference

dim StartTime,NowTime as DateTime
dim ts As TimeSpan 

dim ctime as integer = 1
dim total as integer = 250  'Total # of seconds to count down

StartTime = DateTime.Now()

do while ctime > 0
    NowTime = DateTime.Now()
    ts = NowTime.Subtract(StartTime)
    ctime = total - (((ts.Hours * 60) + ts.Minutes) * 60 + ts.Seconds)

    API.Function("SetText",Input:="9",SelectedName:="Headline.Text",Value:=ctime)
    sleep(500)
Loop
thanks 2 users thanked doggy for this useful post.
dmwkr on 7/10/2023(UTC), nikosman88 on 7/10/2023(UTC)
Joeboe  
#444 Posted : Sunday, July 9, 2023 6:16:50 PM(UTC)
Joeboe

Rank: Advanced Member

Groups: Registered
Joined: 4/16/2017(UTC)
Posts: 578
Location: jamaica

Thanks: 77 times
Was thanked: 32 time(s) in 31 post(s)
Is there a simpler script, using a simple code....
doggy  
#445 Posted : Sunday, July 9, 2023 7:54:25 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,764
Belgium
Location: Belgium

Thanks: 268 times
Was thanked: 868 time(s) in 711 post(s)
Originally Posted by: Joeboe Go to Quoted Post
Is there a simpler script, using a simple code....


for what ????
(sorry can not read minds)
doggy  
#446 Posted : Monday, July 31, 2023 7:13:45 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 4,764
Belgium
Location: Belgium

Thanks: 268 times
Was thanked: 868 time(s) in 711 post(s)
Originally Posted by: Bonbondotkom Go to Quoted Post

I press F2 to Show Inputs in Green Category
Then these what D1 to D9 would do:
D1=Function=PreviewInput&Input=Input10
D2=Function=PreviewInput&Input=Input11
D3=Function=PreviewInput&Input=Input12
D4=Function=PreviewInput&Input=Input13
D5=Function=PreviewInput&Input=Input14
D6=Function=PreviewInput&Input=Input15
D7=Function=PreviewInput&Input=Input16
D8=Function=PreviewInput&Input=Input17
D9=Function=PreviewInput&Input=Input18


Is it doable in scripting without using MoveInput? I don't want to change the input number. Thanks in advance!


yeah maybe but why mess up (highjack) this post up while you allready have a separate post (also highjacked with different original question) addressing your issue/personal request
thanks 1 user thanked doggy for this useful post.
Joeboe69 on 9/5/2023(UTC)
Bonbondotkom  
#447 Posted : Thursday, August 3, 2023 2:04:31 AM(UTC)
Bonbondotkom

Rank: Advanced Member

Groups: Registered
Joined: 7/27/2022(UTC)
Posts: 31
Philippines

Thanks: 11 times
Was thanked: 1 time(s) in 1 post(s)
sorry about that. i just deleted my post here.
richardgatarski  
#448 Posted : Tuesday, September 5, 2023 6:22:29 AM(UTC)
richardgatarski

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2014(UTC)
Posts: 1,725
Location: Stockholm

Thanks: 129 times
Was thanked: 275 time(s) in 230 post(s)
I want a Companion (V3) button to light up if any Input has Solo On. Unfortunately there is no info in vMix's API that reflects solo globally. Here is script that will find if any Input has Solo On. To save vMix's Dynamic values for other uses, the script alters the Loop value of the (arbitrary) Input "Black". And it's loop state can easily be used for Feedback, Triggers, etc in Companion.

Code:
'AnySolo

dim checkStatesIterTime as integer = 200

do while true
    Dim x As New XmlDocument()
    x.LoadXml(API.XML)

    dim soloNode As XmlNode = x.SelectSingleNode("/vmix/inputs/input[@solo='True']")
        If soloNode IsNot Nothing Then
             API.Function("LoopOn",Input:="Black")
          Else
             API.Function("LoopOff",Input:="Black")
        End If

   sleep(checkStatesIterTime)
Loop
thanks 1 user thanked richardgatarski for this useful post.
Roy Sinclair on 9/7/2023(UTC)
richardgatarski  
#449 Posted : Tuesday, September 5, 2023 6:24:14 AM(UTC)
richardgatarski

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2014(UTC)
Posts: 1,725
Location: Stockholm

Thanks: 129 times
Was thanked: 275 time(s) in 230 post(s)
and, of course, one might need a button that turns Solo Off for all Inputs :)

Code:
Dim x As New XmlDocument()
x.LoadXml(API.XML)

dim soloNodesList As XmlNodeList = x.SelectNodes("/vmix/inputs/input[@solo='True']")

for each node as XmlElement In SoloNodesList
  API.Function("SoloOff",Input:=node.GetAttribute("key"))
next
thanks 1 user thanked richardgatarski for this useful post.
Roy Sinclair on 9/7/2023(UTC)
ManuGG  
#450 Posted : Wednesday, September 13, 2023 2:59:24 PM(UTC)
ManuGG

Rank: Newbie

Groups: Registered
Joined: 9/15/2022(UTC)
Posts: 1
Mozambique
Location: Maputo

Thanks: 2 times
Hello there! I have to say thanks for this great thread. As a zero programming skilled person I am gratefull for all posted here.
Excuse me for this little following intro;
for some time I have been working doing a live tv show where there is a moment where people in the set play a trivia. The regular trivia. Host makes questions, each person has a buzzer and so on.
How do i do it? Well, each contestant has its own camera on them. Each camera is a video input on my vmix. What I have done is that each buzzer is connected to vmix. Each one of them works as a keyboard input which i set in vmix as a shortcut. The idea is that when a contestant presses the buzzer it instantely and automatically switchs to his camera and shows him on program output and also some effect overlays, sounds and stuff.

So, each buzzer input as a keyboard key. For example for 3 buzzers keys 1 (D1), 2 (D2) and 3 (D3). On the shortcut menu each one of this shortcuts does the exactly same thing; sets dynamic value to 1 and starts a script ("buzzer"). The 3 shortcuts do exactly the same thing and value.
scren.png (10kb) downloaded 0 time(s).
And, my super-mega script "buzzer" is just this 2 lines:

Function=CutDirect&Input=DynamicInput1
Sleep 20000


Why the sleep? Because as it is a trivia, when the first person buzzes and gets on screen, the other buzzers are disabled. Hence the sleep. So the second and third buzzer are not CutDirect and not switched to the program output and we just stay with the person who buzzed. In the shortcut screenshot you see a D0 shortcut that I use just to stop the script (that is left "sleeping" for no further buzzer activation) so i can re-start the buzzers.
I know its very rudimentary. But it works. The only thing is that as as the script is "sleeping" i get the prompt message "Script Buzzer is already running" so i have to keep pressing "Close" every time/answer. But, it still gets the job done.

If anybody has a proper way to do this, would be glad to see.
Cheers!



Roy Sinclair  
#451 Posted : Thursday, September 14, 2023 6:50:53 AM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 106
United States
Location: Wichita

Thanks: 8 times
Was thanked: 18 time(s) in 14 post(s)
Originally Posted by: ManuGG Go to Quoted Post
Hello there! I have to say thanks for this great thread. As a zero programming skilled person I am gratefull for all posted here.
Excuse me for this little following intro;
for some time I have been working doing a live tv show where there is a moment where people in the set play a trivia. The regular trivia. Host makes questions, each person has a buzzer and so on.
How do i do it? Well, each contestant has its own camera on them. Each camera is a video input on my vmix. What I have done is that each buzzer is connected to vmix. Each one of them works as a keyboard input which i set in vmix as a shortcut. The idea is that when a contestant presses the buzzer it instantely and automatically switchs to his camera and shows him on program output and also some effect overlays, sounds and stuff.

So, each buzzer input as a keyboard key. For example for 3 buzzers keys 1 (D1), 2 (D2) and 3 (D3). On the shortcut menu each one of this shortcuts does the exactly same thing; sets dynamic value to 1 and starts a script ("buzzer"). The 3 shortcuts do exactly the same thing and value.
scren.png (10kb) downloaded 0 time(s).
And, my super-mega script "buzzer" is just this 2 lines:

Function=CutDirect&Input=DynamicInput1
Sleep 20000


Why the sleep? Because as it is a trivia, when the first person buzzes and gets on screen, the other buzzers are disabled. Hence the sleep. So the second and third buzzer are not CutDirect and not switched to the program output and we just stay with the person who buzzed. In the shortcut screenshot you see a D0 shortcut that I use just to stop the script (that is left "sleeping" for no further buzzer activation) so i can re-start the buzzers.
I know its very rudimentary. But it works. The only thing is that as as the script is "sleeping" i get the prompt message "Script Buzzer is already running" so i have to keep pressing "Close" every time/answer. But, it still gets the job done.

If anybody has a proper way to do this, would be glad to see.
Cheers!





I would add a single if statement to the script. That if statement would check to see if the DynamicInput1 is set to one of the player cameras already, if not already set to one of the players do your Function=CutDirect&Input=DynamicInput1.

Now create a copy of the script for each player and set up the trigger for each player to start their copy of the script instead of all players starting one script.


With each player having their own copy of the script, you don't get the "script is already running" prompts but since the first to press gets the input set to their camera none of the others can take it, no wait 20000 needed.
thanks 1 user thanked Roy Sinclair for this useful post.
ManuGG on 9/16/2023(UTC)
Nguyendung  
#452 Posted : Saturday, September 23, 2023 11:55:07 AM(UTC)
Nguyendung

Rank: Newbie

Groups: Registered
Joined: 4/9/2022(UTC)
Posts: 2
Viet Nam
Location: Hanoi

First off all, i am sorry about my English (i'm using Google translate)
How to call input by short name by script
Example
i have a inputname "ABCD#1234" (ABCE is shortname, and 1234 is note infomation)
how to
API.Function("Cut",Input:="ABCD")
same
API.Function("Cut",Input:="ABCD#1234")
Tks for support.
Roy Sinclair  
#453 Posted : Tuesday, September 26, 2023 7:58:56 AM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 106
United States
Location: Wichita

Thanks: 8 times
Was thanked: 18 time(s) in 14 post(s)
Originally Posted by: Nguyendung Go to Quoted Post
First off all, i am sorry about my English (i'm using Google translate)
How to call input by short name by script
Example
i have a inputname "ABCD#1234" (ABCE is shortname, and 1234 is note infomation)
how to
API.Function("Cut",Input:="ABCD")
same
API.Function("Cut",Input:="ABCD#1234")
Tks for support.


There is no "Cut" function, only "CutDirect" which is probably why the things you've been trying didn't work.

Best practice it to use the KEY value for the input instead of it's number or it's name. The number and the name can be changed but unless the input is deleted and added back again the KEY value for that input will never change. And yeah, it's a hideous thing to type but that's what cut and paste are for.

Code:


For example this is the http://localhost:8088/api response from vMIX (copy I'm running)
...
<input key="fda8cd85-095d-4c40-98ba-b98800c02eaa" number="1" type="Stream" title="Center Camera" shortTitle="Center Camera" state="Running" position="0" duration="0" loop="False" muted="True" volume="100" balance="0" solo="False" audiobusses="" meterF1="0" meterF2="0" gainDb="0">Center Camera</input>
...


So my call to switch to the "Center Camera" (using the format you used) would be:

API.Function("CutDirect",Input:="fda8cd85-095d-4c40-98ba-b98800c02eaa")
Users browsing this topic
23 Pages«<212223
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.