logo

Live Production Software Forums


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

Notification

Icon
Error

26 Pages«<2122232425>»
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: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 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: 33 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 7 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), monamiga on 7/4/2024(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: 5,243
Belgium
Location: Belgium

Thanks: 294 times
Was thanked: 960 time(s) in 794 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: 5,243
Belgium
Location: Belgium

Thanks: 294 times
Was thanked: 960 time(s) in 794 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: 5,243
Belgium
Location: Belgium

Thanks: 294 times
Was thanked: 960 time(s) in 794 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,838
Location: Stockholm

Thanks: 144 times
Was thanked: 297 time(s) in 250 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,838
Location: Stockholm

Thanks: 144 times
Was thanked: 297 time(s) in 250 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: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 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

Thanks: 2 times
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: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 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")
doggy  
#454 Posted : Monday, October 16, 2023 10:22:56 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,243
Belgium
Location: Belgium

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Populate Layers of an input with the previews of the first 10 mixes / and update if they transition (Don't Ask why ;-) )


Code:
'Populating the layers of an input with the previews of Mixes (max 9)

Dim MVInput as string = "Colour"  'number or name of the multiview Input
Dim MaxMix as integer = 10        'max number of Mix  Inputs to check / use in order (max 10 layers)
Dim MixNumberPV as string = "0"   'just a check for existing defined input in the Mix
dim y as integer = 1

dim xml as string = API.XML()
dim x as new system.xml.xmldocument

do while true

    x.loadxml(API.XML())
    Dim nodeList As XmlNodeList = x.SelectNodes("//mix")
    y = 1

    For each node as XmlElement In nodeList         
        MixNumberPV = (node.SelectSingleNode("preview").InnerText)
        if MixNumberPV <> "0"
            API.Function("SetLayer",Input:=MVInput ,Value:= y.tostring & "," & MixNumberPV )
        else
            API.Function("SetLayer",Input:=MVInput ,Value:= y.tostring & ",None" )
        end if          
        y+=1
        if Y > MaxMix        
            exit for
        end if
    next
    sleep(500)  
loop

thanks 2 users thanked doggy for this useful post.
dmwkr on 10/16/2023(UTC), Video-Chopper on 10/17/2023(UTC)
joeb1  
#455 Posted : Thursday, October 19, 2023 8:14:56 PM(UTC)
joeb1

Rank: Newbie

Groups: Registered
Joined: 11/9/2021(UTC)
Posts: 1

Hi all.

I'm trying to get the name of the currently subscribed NDI source to a VMix input as a string for .net scripting.
Maybe something comparable to:

exampletext as string = (Input.Find("Example_Graphic").Text("Line 1.Text"))

The api.xml doesn't seem to give the source name but the .vmix preset file does. However I need to query this live so that would only work if the preset was saved after the NDI source changed.

Any suggestions would be appreciated, thank you :)
doggy  
#456 Posted : Thursday, October 19, 2023 9:07:32 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,243
Belgium
Location: Belgium

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: joeb1 Go to Quoted Post
Hi all.

I'm trying to get the name of the currently subscribed NDI source to a VMix input as a string for .net scripting.
Maybe something comparable to:

The api.xml doesn't seem to give the source name


You sure ? (shortTitle=)

Quote:
but the .vmix preset file does. However I need to query this live so that would only work if the preset was saved after the NDI source changed.

Any suggestions would be appreciated, thank you :)


Maybe check for it the "Last" preset (auto updates every minute)
nikosman88  
#457 Posted : Saturday, November 18, 2023 10:41:51 PM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 543
Greece
Location: athens

Thanks: 130 times
Was thanked: 74 time(s) in 70 post(s)
Hello guys. Is there any way the number of the overlay channel to be transcoded in to the real input name? I want to keep logs of what im playing in my overlay channels so i used as base this script
https://forums.vmix.com/...or-commercials#post99914 and this https://forums.vmix.com/...ng-for-Dummies#post71167
the script is this for example for overlay1 channel
Code:

''''''''''''''''
' Script von Mats Julian Steffens
' www.lvstrm.de
''''''''''''''''
'
' Log everything you are playing
'
''''''''''''''''
dim dateinamealt as string = ""

do
dim datum as string
datum = DateTime.Now.ToString("yyMMdd")

dim filename as string
filename="C:\vMix log\overlay1\"+datum+"-vmixlog.txt"     'Where to save the file


If (Not System.IO.File.Exists(filename)) Then
   My.Computer.FileSystem.WriteAllText(filename, " ", True)
End If

''''''''''''''''

dim timestamp as string
timestamp = DateTime.Now.ToString("dd/MM/yy HH:mm:ss")

dim xml as string = API.XML()
dim ovl1input as string = ""
dim x as new system.xml.xmldocument
x.loadxml(xml)

ovl1input = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)
dim dateiname as string = (x.SelectSingleNode("//overlays//overlay[1]").InnerText)


if (ovl1input = nothing) 
'we don't have 2 PIP overlays, no point in continuing then

end if

dim inputnamelaenge as string

If (ovl1input = dateiname) Then
    inputnamelaenge = 0
Else
    inputnamelaenge = ovl1input.Length()+3
End If


dim inputString as string

'Datei schreiben
If (dateinamealt <> dateiname) Then
    inputString = timestamp + " " + dateiname.Substring(inputnamelaenge) + Environment.NewLine 

    Console.WriteLine(inputString)

    My.Computer.FileSystem.WriteAllText(filename, inputString, True)
    dateinamealt = dateiname

End If

sleep(1000)
loop


Ιt work ok but is there any way in txt log file instead of the input number to record the input name? I need somehow to transcode the input number from overlay api xml record to the input name and then write it to the txt file. Is this possible? Thank you
doggy  
#458 Posted : Saturday, November 18, 2023 11:44:20 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,243
Belgium
Location: Belgium

Thanks: 294 times
Was thanked: 960 time(s) in 794 post(s)
Originally Posted by: nikosman88 Go to Quoted Post
Hello guys. Is there any way the number of the overlay channel to be transcoded in to the real input name? I want to keep logs of what im playing in my overlay channels so i used as base this script
https://forums.vmix.com/...or-commercials#post99914 and this https://forums.vmix.com/...ng-for-Dummies#post71167
the script is this for example for overlay1 channel

Ιt work ok but is there any way in txt log file instead of the input number to record the input name? I need somehow to transcode the input number from overlay api xml record to the input name and then write it to the txt file. Is this possible? Thank you


get the Input's innertext matching the number

Code:
'X is the variable holding the input number
Dim name as string = x.SelectSingleNode("//input[@number=" & X & "]").InnerText
thanks 1 user thanked doggy for this useful post.
nikosman88 on 11/19/2023(UTC)
nikosman88  
#459 Posted : Sunday, November 19, 2023 4:28:38 AM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 543
Greece
Location: athens

Thanks: 130 times
Was thanked: 74 time(s) in 70 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
Hello guys. Is there any way the number of the overlay channel to be transcoded in to the real input name? I want to keep logs of what im playing in my overlay channels so i used as base this script
https://forums.vmix.com/...or-commercials#post99914 and this https://forums.vmix.com/...ng-for-Dummies#post71167
the script is this for example for overlay1 channel

Ιt work ok but is there any way in txt log file instead of the input number to record the input name? I need somehow to transcode the input number from overlay api xml record to the input name and then write it to the txt file. Is this possible? Thank you


get the Input's innertext matching the number

Code:
'X is the variable holding the input number
Dim name as string = x.SelectSingleNode("//input[@number=" & X & "]").InnerText


Thank you. Im trying to do it.
Salvatore  
#460 Posted : Tuesday, November 21, 2023 5:26:17 AM(UTC)
Salvatore

Rank: Advanced Member

Groups: Registered
Joined: 11/15/2021(UTC)
Posts: 72
Italy

Thanks: 8 times
Was thanked: 9 time(s) in 7 post(s)
Hy guys,

It is possible to change a Text value by Looking for name and Not for the Index nr?



Code:
API.Function("ChangeCountdown",Input:="Timer Centre.gtzip", SelectedIndex:="0", Value:="00:05")



Something like:
API.Function("ChangeCountdown",Input:="Timer Centre.gtzip", Selectet Name:="countdown1.Text", Value:="00:05")
Users browsing this topic
Guest (8)
26 Pages«<2122232425>»
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.