logo

Live Production Software Forums


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

Notification

Icon
Error

26 Pages«<45678>»
Options
Go to last post Go to first unread
doggy  
#101 Posted : Wednesday, May 26, 2021 11:13:59 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Have more variables into 1 DynamicValue and select them by their position(number) and update


Code:
API.Function("SetDynamicValue1",Value:="value1,value2,value3,value4")

dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim MyValues as string = (x.SelectSingleNode("//dynamic/value1").InnerText)

dim MyVals() as string = MyValues.Split(",")

For i As Integer = 0 To MyVals.Length - 1
Console.WriteLine(MyVals(i))
Next

'replace one of the values
MyVals(1) = "Cat"

'save the updated values
Dim result As String = String.Join(",", str2)
API.Function("SetDynamicValue1",Value:=result )

endiaer  
#102 Posted : Monday, June 7, 2021 3:33:35 PM(UTC)
endiaer

Rank: Member

Groups: Registered
Joined: 1/6/2014(UTC)
Posts: 15

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: doggy Go to Quoted Post
Launch external application

Code:
'Launch an application and resume the script  when  app is closed 
Dim P As New Process
    P = Process.Start("notepad.exe")
    P.WaitForExit()


'Launch an application (example notepad with specified existing file)
Dim ExtApp As New ProcessStartInfo
ExtApp.FileName = "notepad.exe"
ExtApp.Arguments = "d:/demo.txt"
ExtApp.UseShellExecute = True
ExtApp.WindowStyle = ProcessWindowStyle.Normal
Dim proc As Process = Process.Start(ExtApp)





I need to run .bat file please help!
thanks 1 user thanked endiaer for this useful post.
studiodelta on 12/11/2022(UTC)
doggy  
#103 Posted : Monday, June 7, 2021 6:41:29 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: endiaer Go to Quoted Post


I need to run .bat file please help!


Just replace the notepad.exe with your xxx.bat file (first example)
thanks 1 user thanked doggy for this useful post.
endiaer on 6/19/2021(UTC)
endiaer  
#104 Posted : Saturday, June 19, 2021 6:35:24 PM(UTC)
endiaer

Rank: Member

Groups: Registered
Joined: 1/6/2014(UTC)
Posts: 15

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Helo, is it possible to trigger something based on a certain time value in the timer? my timer is 10:00 minutes and i want to make a script to start streaming at the left 01:00. Thank you.
doggy  
#105 Posted : Saturday, June 19, 2021 7:05:29 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: endiaer Go to Quoted Post
Helo, is it possible to trigger something based on a certain time value in the timer? my timer is 10:00 minutes and i want to make a script to start streaming at the left 01:00. Thank you.


Sure read the current displayed time within the title from the API XML and code your decision and commands based on that . How to get that info (time) has been addressed in previous posts here
thanks 1 user thanked doggy for this useful post.
endiaer on 6/25/2021(UTC)
Roy Sinclair  
#106 Posted : Thursday, June 24, 2021 6:55:47 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)
The small icon or logo that appears then disappears on network television is called a "bug". It's not present all the time because it can cause burn in issues (faint ghost of the bug visible even when it's not being shown) on the screens displaying the video.

I wrote a simple script to turn the bug on for one minute out of every five minutes

Code:

'Bug control, turn on the Identity Bug for one minute out of every five minutes


console.writeline ( "Bug control started")
Dim BugIsOn as boolean = false
API.Function("OverlayInput4Out")

Do While True
     Dim LastDigitOfMinutes as string = DateTime.Now.ToString("mm").substring(1,1)
     if BugIsOn then
        If LastDigitOfMinutes <> "5" and LastDigitOfMinutes <> "0" Then
            ' No longer a minute ending with 0 or 5 so turn the bug off
            API.Function("OverlayInput4Out") 
            BugIsOn = false
        End If
    else
        If LastDigitOfMinutes = "5" or LastDigitOfMinutes = "0" Then
            ' Minute now ends with "0" or "5" - Turn the bug on
            API.Function("OverlayInput4In",Input:="<<name of your input goes here>>")
            BugIsOn = true
        End If
    End If
    sleep(1000)  ' Sleep for one second
Loop


We use overlay 4 for our bug and while you can use the input number instead of the name of your input in your script it's subject to breakage if someone removes a lower numbered input. Of course if someone renames the input it will also break but I prefer that risk.

This script runs as a vMix global script under Settings>Scripting
doggy  
#107 Posted : Thursday, June 24, 2021 7:42:02 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Roy Sinclair Go to Quoted Post


We use overlay 4 for our bug and while you can use the input number instead of the name of your input in your script it's subject to breakage if someone removes a lower numbered input. Of course if someone renames the input it will also break but I prefer that risk.



one can always use the input's ID number
thanks 1 user thanked doggy for this useful post.
Black Dog on 7/1/2021(UTC)
Roy Sinclair  
#108 Posted : Thursday, June 24, 2021 7:59:17 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: doggy Go to Quoted Post
Originally Posted by: Roy Sinclair Go to Quoted Post


We use overlay 4 for our bug and while you can use the input number instead of the name of your input in your script it's subject to breakage if someone removes a lower numbered input. Of course if someone renames the input it will also break but I prefer that risk.



one can always use the input's ID number


I said that ;).
doggy  
#109 Posted : Thursday, June 24, 2021 8:23:32 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: Roy Sinclair Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Roy Sinclair Go to Quoted Post


We use overlay 4 for our bug and while you can use the input number instead of the name of your input in your script it's subject to breakage if someone removes a lower numbered input. Of course if someone renames the input it will also break but I prefer that risk.



one can always use the input's ID number


I said that ;).


Nope: Input number and input ID (or key) are 2 different things ;-)

InputKey.JPG (40kb) downloaded 2 time(s).
Roy Sinclair  
#110 Posted : Thursday, June 24, 2021 11:57:09 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: doggy Go to Quoted Post


Nope: Input number and input ID (or key) are 2 different things ;-)

InputKey.JPG (40kb) downloaded 2 time(s).



Oh yeah, that's right. That's a number that won't change unless the input is deleted and recreated. Probably should be using that.


endiaer  
#111 Posted : Friday, June 25, 2021 12:22:07 AM(UTC)
endiaer

Rank: Member

Groups: Registered
Joined: 1/6/2014(UTC)
Posts: 15

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
hi doggy, this is my scenario : when an active Inputlist is playing an item on pgm, check the name of the next item (file) and if the name contains "VOT " than do something (anable loop to that active list). please help i am a dummy.
doggy  
#112 Posted : Friday, June 25, 2021 1:03:04 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: endiaer Go to Quoted Post
an active Inputlist is playing


What is an "active Inputlist" ? Can we please stick to vMix words, don't feel like having to guess what one means


endiaer  
#113 Posted : Friday, June 25, 2021 5:58:19 AM(UTC)
endiaer

Rank: Member

Groups: Registered
Joined: 1/6/2014(UTC)
Posts: 15

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: endiaer Go to Quoted Post
an active Inputlist is playing


What is an "active Inputlist" ? Can we please stick to vMix words, don't feel like having to guess what one means




Sorry for my poor english. I mean input of video list that is currently playing
doggy  
#114 Posted : Friday, June 25, 2021 8:08:08 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: endiaer Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: endiaer Go to Quoted Post
an active Inputlist is playing


What is an "active Inputlist" ? Can we please stick to vMix words, don't feel like having to guess what one means




Sorry for my poor english. I mean input of video list that is currently playing


Still not sure: either its a Playlist or a List Input

Playlist: one can not check the next item in the list , only the current one playing
List : one can pull the list from the API xml and the one that is selected/playing (so one could theoretically deduct which would be the next one in line)

BUT why not just have either one (list or playlist) build properly and have either one just on loop? no testing needed

ron2210  
#115 Posted : Friday, June 25, 2021 6:21:36 PM(UTC)
ron2210

Rank: Member

Groups: Registered
Joined: 8/4/2020(UTC)
Posts: 16
Man
India
Location: Mumbai

Thanks: 16 times
Was thanked: 4 time(s) in 2 post(s)
Originally Posted by: endiaer Go to Quoted Post
hi doggy, this is my scenario : when an active Inputlist is playing an item on pgm, check the name of the next item (file) and if the name contains "VOT " than do something (anable loop to that active list). please help i am a dummy.


Code:
dim doc as New System.Xml.Xmldocument
doc.LoadXml(API.XML())

Dim strListName as String = "ListName"
Dim strListID as string = doc.SelectSingleNode("/vmix/inputs/input[@shortTitle='"+ strListName +"']").Attributes("number").Value
Dim strPgmID as string
dim strNextItemName as String


strPgmID = doc.SelectSingleNode("/vmix/active").InnerText
strNextItemName = doc.SelectSingleNode("/vmix/inputs/input[@shortTitle='" & strListName & "']/list/item[@selected=""true""]/following-sibling::item").InnerText

if strPgmID = strListID and strNextItemName.contains("VOT") then
'List LoopOn
else
'List LoopOff
end if
thanks 3 users thanked ron2210 for this useful post.
doggy on 6/25/2021(UTC), endiaer on 6/27/2021(UTC), nikosman88 on 1/28/2022(UTC)
endiaer  
#116 Posted : Sunday, June 27, 2021 6:35:05 PM(UTC)
endiaer

Rank: Member

Groups: Registered
Joined: 1/6/2014(UTC)
Posts: 15

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: ron2210 Go to Quoted Post
Originally Posted by: endiaer Go to Quoted Post
hi doggy, this is my scenario : when an active Inputlist is playing an item on pgm, check the name of the next item (file) and if the name contains "VOT " than do something (anable loop to that active list). please help i am a dummy.


Code:
dim doc as New System.Xml.Xmldocument
doc.LoadXml(API.XML())

Dim strListName as String = "ListName"
Dim strListID as string = doc.SelectSingleNode("/vmix/inputs/input[@shortTitle='"+ strListName +"']").Attributes("number").Value
Dim strPgmID as string
dim strNextItemName as String


strPgmID = doc.SelectSingleNode("/vmix/active").InnerText
strNextItemName = doc.SelectSingleNode("/vmix/inputs/input[@shortTitle='" & strListName & "']/list/item[@selected=""true""]/following-sibling::item").InnerText

if strPgmID = strListID and strNextItemName.contains("VOT") then
'List LoopOn
else
'List LoopOff
end if


it works, my project of automation has been completed. Thank you Rom2210 and doggy
NDI_SRT  
#117 Posted : Tuesday, June 29, 2021 12:47:41 AM(UTC)
NDI_SRT

Rank: Newbie

Groups: Registered
Joined: 6/29/2021(UTC)
Posts: 3
Indonesia
Location: Manado

Thanks: 1 times
Hello Expert,

Is it Possible to enable/disable and move among items in list using script since there are no functions available? If yes, please help give some syntax!
doggy  
#118 Posted : Tuesday, June 29, 2021 1:17:31 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: NDI_SRT Go to Quoted Post
Hello Expert,

Is it Possible to enable/disable and move among items in list using script since there are no functions available? If yes, please help give some syntax!


Open the list editor and use the mouse to move amongst the items or change the order.

Maybe explain a bit better your intentions
thanks 1 user thanked doggy for this useful post.
NDI_SRT on 7/5/2021(UTC)
NDI_SRT  
#119 Posted : Tuesday, July 6, 2021 5:14:28 PM(UTC)
NDI_SRT

Rank: Newbie

Groups: Registered
Joined: 6/29/2021(UTC)
Posts: 3
Indonesia
Location: Manado

Thanks: 1 times
Originally Posted by: doggy Go to Quoted Post
From a recent request/discussion to trigger something BEFORE a video finishes


Code:
' Checking time left of active input
' and do some stuff at certain time remaining

dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim Timeleft as double = 0
dim triggertime as integer = 2000       '2 seconds before end
dim triggerduration as integer = 2000   'fade duration, could be different than trigger

do while true

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

activeinput = (x.SelectSingleNode("//active").InnerText)
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)

Timeleft= Double.Parse(duration)-Double.Parse(position)

if Timeleft < triggertime  

  API.Function("SetVolumeFade",Input:=activeinput.tostring(),Value:="0," & triggerduration.tostring())
  ' do whatever one wants to do 

end if

sleep(500)
Loop


Thanks for this script. I will use it for playing list of several items in AutoNext mode. I want the trigger to occur once at the last item with their total duration and not before every item ends. What should be the syntax like? Thank you for help
doggy  
#120 Posted : Tuesday, July 6, 2021 6:08:18 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: NDI_SRT Go to Quoted Post

Thanks for this script. I will use it for playing list of several items in AutoNext mode.


Why would you need this script if you are playing the list in auto next ?

Quote:
I want the trigger to occur once at the last item with their total duration and not before every item ends.


Again , the mentioned script is not applicable then (some of it's ideas might)

Quote:
What should be the syntax like?


So you want someone to solve your specific request by writing code for you ? With all due respect I suggest hiring a programmer!

Tell the programmer the code needs to check for the last item being played, check when its at the end of its play and then perform the trigger.

There are often several different ways to skin a cat. This thread provides little tidbits and ideas to start from and learn.
Users browsing this topic
Guest (3)
26 Pages«<45678>»
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.