Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: nikosman88 ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif)
Ok im not script guru so i am trying to combine things from "here" and "there".. Try not to laugh :p with my logic i do the things At first i add dim markout as string = "" then i add the line that reads markout as first line after activeinput and the script doesnt start. it says object line error. Then i put this line after position line and script start but not work. Then i tried Timeleft= Double.Parse(duration)-Double.Parse(position) to change to Timeleft= Double.Parse(duration)-Double.Parse(markout) or Timeleft= Double.Parse(position)-Double.Parse(markout) some combinations here,dont work Then i see to xml manually the total time of video (that of course will need to change every time because not all videos are have to be split for example 30minutes exactly) so for the specific video that said markout=1900340 and i wanted to do the "script thing" 8sec before it reaches the markout point to change the triggertime. As value in triggertime i tried to do some mathematical actions and put the result actual duration - markout duration -8sec.. Of course it didnt work and if i have for every video that i need something to do before it ends,to take the calculator, i prefer to do edit real editing in premiere. That`s the way i tried and search..
Why not check on "state" instead of trying calculations etc ;-) (or use a trigger oncompletion instead of a script) if you want to use it in a script check on status running or completed , or trigger to call a script. KISS PS original script is fr doing an action BEFORE a certain position is reached Quote: i am trying to combine things from "here" and "there". Best is to stay away from scripting then. Is better to learn than throwing things to a wall and see what sticks
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: doggy ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) 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
Adjusted for using MarkOut points ![](/Themes/yafpro/icon_file.gif) Screenshot 2023-02-11 133611.jpg (95kb) downloaded 4 time(s).
|
![thanks](/Themes/yafpro/heart_small.png) 1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 404 ![Greece Greece](/Content/images/flags/GR.png) Location: athens Thanks: 115 times Was thanked: 63 time(s) in 59 post(s)
|
Edit Your "markout" script work perfect!!! Thank you very much. Originally Posted by: doggy ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Originally Posted by: nikosman88 ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif)
Ok im not script guru so i am trying to combine things from "here" and "there".. Try not to laugh :p with my logic i do the things At first i add dim markout as string = "" then i add the line that reads markout as first line after activeinput and the script doesnt start. it says object line error. Then i put this line after position line and script start but not work. Then i tried Timeleft= Double.Parse(duration)-Double.Parse(position) to change to Timeleft= Double.Parse(duration)-Double.Parse(markout) or Timeleft= Double.Parse(position)-Double.Parse(markout) some combinations here,dont work Then i see to xml manually the total time of video (that of course will need to change every time because not all videos are have to be split for example 30minutes exactly) so for the specific video that said markout=1900340 and i wanted to do the "script thing" 8sec before it reaches the markout point to change the triggertime. As value in triggertime i tried to do some mathematical actions and put the result actual duration - markout duration -8sec.. Of course it didnt work and if i have for every video that i need something to do before it ends,to take the calculator, i prefer to do edit real editing in premiere. That`s the way i tried and search..
Why not check on "state" instead of trying calculations etc ;-) (or use a trigger oncompletion instead of a script) if you want to use it in a script check on status running or completed , or trigger to call a script. KISS PS original script is fr doing an action BEFORE a certain position is reached Quote: i am trying to combine things from "here" and "there". Best is to stay away from scripting then. Is better to learn than throwing things to a wall and see what sticks on state or on completion will not work because it says either "running" or "paused". And i want to do something before video ends. Anyway your script is what i wanted and thank you again. Yes i try to learn but i dont have the time or the way to learn everything in vb.net. But im trying to learn and if i know something i will help to this forum because this forum helps me. For example 2 scripts i made myself after searching how https://forums.vmix.com/...-List-Restart#post106220 and https://forums.vmix.com/...77-Text-files#post106377 simple scripts but for me it took much time to understand how it will work
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/16/2022(UTC) Posts: 4 ![Algeria Algeria](/Content/images/flags/DZ.png) Location: Batna
|
Hello please i need help live bloomberg ticker like this ![like this like this](https://tube.marefa.org/videos/ShafeionSharqNews_6192e5894f12c8.99081946.jpg)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: bilalesb ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Hello please i need help live bloomberg ticker like this ![like this like this](https://tube.marefa.org/videos/ShafeionSharqNews_6192e5894f12c8.99081946.jpg) This is nothing to do with scripting but with GT titles'\A static image does not tell us much regarding the ticker specifics. Please do an effort to explain/show what exactly your goal is in a proper post/forum
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/16/2022(UTC) Posts: 4 ![Algeria Algeria](/Content/images/flags/DZ.png) Location: Batna
|
Originally Posted by: doggy ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Originally Posted by: bilalesb ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Hello please i need help live bloomberg ticker like this ![like this like this](https://tube.marefa.org/videos/ShafeionSharqNews_6192e5894f12c8.99081946.jpg) This is nothing to do with scripting but with GT titles'\A static image does not tell us much regarding the ticker specifics. Please do an effort to explain/show what exactly your goal is in a proper post/forum this live take a look i need help to make ticker of bloomberg
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: bilalesb ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) take a look i need help to make ticker of bloomberg
Again this is in the wrong forum and post , please post GT title related questions here https://forums.vmix.com/topics/12-GT
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/5/2020(UTC) Posts: 91 ![Indonesia Indonesia](/Content/images/flags/ID.png) Location: Jakarta Thanks: 17 times Was thanked: 5 time(s) in 3 post(s)
|
Hi,
Is it possible to know when a SRT Client is Connected via Script? The background is to display LARIX QR Code when there is no Client Connected and Removes it once Connection Established.
Thanks in advance.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 404 ![Greece Greece](/Content/images/flags/GR.png) Location: athens Thanks: 115 times Was thanked: 63 time(s) in 59 post(s)
|
Originally Posted by: gpdipalmerahtimur ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Hi,
Is it possible to know when a SRT Client is Connected via Script? The background is to display LARIX QR Code when there is no Client Connected and Removes it once Connection Established.
Thanks in advance. Hello. A way to do this is if your srt input when connected has audio. If yes, you can check api xml to see if audio is coming or not and then do what you want to do. A script to do this is, can be like that Code:
Do while true
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
'set the name of your input
dim AU = (x.SelectSingleNode("//input[@shortTitle='nameyourinputorinputkey']/@meterF1").Value)
'check audio of this input'
If AU > 0 Then
'do whatever you want to do'
ElseIf AU = 0 Then
End if
loop
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 6/5/2020(UTC) Posts: 91 ![Indonesia Indonesia](/Content/images/flags/ID.png) Location: Jakarta Thanks: 17 times Was thanked: 5 time(s) in 3 post(s)
|
Hi nikosman88,
Thanks for your help, unfortunately we have flaw on that approach, if Cameraman decided to mute LARIX on his Phone then the action will be triggered falsely.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 1/12/2021(UTC) Posts: 12 ![Germany Germany](/Content/images/flags/DE.png) Location: Rosenheim Thanks: 1 times Was thanked: 1 time(s) in 1 post(s)
|
Hi, I've found this script that helped me a lot. Originally Posted by: titasas ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Code:do while True
if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
else
API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
end if
sleep(500)
Loop
But in my case I need to check if an image is set in the title editor or not. Unfortunately I do not get this done My code: Code:do while True
if Input.Find("Whatsapp nur Text").Text("bild.Source") = "" and Input.Find("Whatsapp nur Text").Text("Text.Text") <> "" then
API.Function("OverlayInput1In",Input:="Whatsapp nur Text")
elseif Input.Find("Whatsapp nur Text").Text("bild.Source") <> "" and Input.Find("Whatsapp nur Text").Text("Text.Text") = "" then
API.Function("OverlayInput1In",Input:="Whatsapp nur Bild")
else API.Function("OverlayInput1In",Input:="Whatsapp Bild und Text")
end if
sleep(500)
Loop
I have already tried a few things. .Text("bild.Source") .Source("bild.Source") .Image("bild.Source") .Pciture("bild.Source") Can anybody please help me? Andi
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: Huaba ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) My code: Code:do while True
if Input.Find("Whatsapp nur Text").Text("bild.Source") = "" and Input.Find("Whatsapp nur Text").Text("Text.Text") <> "" then
API.Function("OverlayInput1In",Input:="Whatsapp nur Text")
elseif Input.Find("Whatsapp nur Text").Text("bild.Source") <> "" and Input.Find("Whatsapp nur Text").Text("Text.Text") = "" then
API.Function("OverlayInput1In",Input:="Whatsapp nur Bild")
else API.Function("OverlayInput1In",Input:="Whatsapp Bild und Text")
end if
sleep(500)
Loop
I have already tried a few things. .Text("bild.Source") .Source("bild.Source") .Image("bild.Source") .Pciture("bild.Source") Can anybody please help me? Andi Use checking the vMix API XML file content instead
|
|
|
|
Rank: Member
Groups: Registered
Joined: 1/12/2021(UTC) Posts: 12 ![Germany Germany](/Content/images/flags/DE.png) Location: Rosenheim Thanks: 1 times Was thanked: 1 time(s) in 1 post(s)
|
Do you have a code example for this, please?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: Huaba ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Do you have a code example for this, please? You are in the right post subject allread, start from the top
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 404 ![Greece Greece](/Content/images/flags/GR.png) Location: athens Thanks: 115 times Was thanked: 63 time(s) in 59 post(s)
|
Hello guys. A great tool for script by dummies or for general vb.net code that we dont know how to do or if possible to do is Chatgpt AI. If we give it, the details it needs, it can do a big piece of our vb.net script. I needed a script that will find if a specific input in vmix exists and if exists to rename it to a random name. The result after telling chatgpt for vmix xml file and some more details is this Code:
Dim xml As String = API.XML()
Dim x As New System.Xml.XmlDocument()
x.LoadXml(xml)
Dim apiUrl As String = "http://127.0.0.1:8088/api"
'set the name of your input
Dim inputNodeBack1 As XmlNode = x.SelectSingleNode("//input[@title='back1']")
If inputNodeBack1 IsNot Nothing Then
Dim randomName As String = "Input" & Guid.NewGuid().ToString().Substring(0, 5)
inputNodeBack1.Attributes("title").Value = randomName
inputNodeBack1.Attributes("shortTitle").Value = randomName ' update shortTitle as well
Dim client As New WebClient()
Dim xmlString As String = x.OuterXml
client.Headers("Content-Type") = "application/xml"
client.UploadString(apiUrl, "POST", xmlString)
API.Function("SetInputName", Input:="back1", Value:=randomName)
Console.WriteLine("Input 'back1' renamed to '" & randomName & "'")
Else
Console.WriteLine("Input 'back1' does not exist")
End If
Of course a vb.net person script guru can make something better but for us who dont know how and where to search chatgpt can help a lot. What impressed me the most was that it created a script that told the vmix console that the input file had been renamed, but in reality nothing changed inside vmix. I told it that, and it replied that "vmix probably doesn't support file renaming while it's running." Then I thought of telling it that vmix does support it and i give to it the command "API.Function("SetInputName", Input:="My input", Value:="My new input name")" and he fixed the command on his own, as you can see in the above script."
|
![thanks](/Themes/yafpro/heart_small.png) 1 user thanked nikosman88 for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/15/2021(UTC) Posts: 68 ![Italy Italy](/Content/images/flags/IT.png) Thanks: 7 times Was thanked: 8 time(s) in 6 post(s)
|
Hi, i was wondering if it's possible to play a certain Soundfile from a List (not PlayList) without playing in PGM For example, my list contains 3 sound files. I would like to play file two detached from PGM MyList Sound1.wav Sound2.wav Sound3.wav This Play the List, but how to select the file?: Code:API.Function("Play", Input:="MyList")
This don't work: Code:API.Function("Play", Input:="MyList", Value:="Sound2.wav")
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: Salvatore ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Hi, i was wondering if it's possible to play a certain Soundfile from a List (not PlayList) without playing in PGM For example, my list contains 3 sound files. I would like to play file two detached from PGM MyList Sound1.wav Sound2.wav Sound3.wav The Shortcut Function Reference show only this to play a list: Code:API.Function("ListPlayOut", Input:="MyList")
This Play the List: Code:API.Function("Play", Input:="MyList")
But how to select the file? you cant unless manually What do you mean by detached/not playing from PGN? As in not "captured" in the output ?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/15/2021(UTC) Posts: 68 ![Italy Italy](/Content/images/flags/IT.png) Thanks: 7 times Was thanked: 8 time(s) in 6 post(s)
|
Originally Posted by: doggy ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) What do you mean by detached/not playing from PGN? As in not "captured" in the output ?
i want to play the sounds on AudioOutput B
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,171 ![Belgium Belgium](/Content/images/flags/BE.png) Location: Belgium Thanks: 288 times Was thanked: 942 time(s) in 778 post(s)
|
Originally Posted by: Salvatore ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Originally Posted by: doggy ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) What do you mean by detached/not playing from PGN? As in not "captured" in the output ?
i want to play the sounds on AudioOutput B Use audio as regulare inputs and set it to bus B
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 404 ![Greece Greece](/Content/images/flags/GR.png) Location: athens Thanks: 115 times Was thanked: 63 time(s) in 59 post(s)
|
Originally Posted by: Salvatore ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) Originally Posted by: doggy ![Go to Quoted Post Go to Quoted Post](/Themes/yafpro/icon_latest_reply.gif) What do you mean by detached/not playing from PGN? As in not "captured" in the output ?
i want to play the sounds on AudioOutput B Uncheck from audio settings that belong to your list the button M and select B. Then press play manually and it will start play. By commands you can do it this way 1. Check audio in your list so it will be green the button 2.Uncheck button M 3. Make a script like this that will uncheck the M and select the B bus and then a shortcut for it Code:
API.Function("AudioBusOff", Input:="1", Value:="M")
API.Function("AudioBusOn", Input:="1", Value:="B")
API.Function("Play", Input:="1")
of course you can make more commands like selectindex for specific clip in your list
|
![thanks](/Themes/yafpro/heart_small.png) 2 users thanked nikosman88 for this useful post.
|
|
|
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