vMix Forums
»
General
»
General Discussion
»
Script on How to add delay to an overlay?
Rank: Member
Groups: Registered
Joined: 8/17/2023(UTC) Posts: 12 Location: Rio de Janeiro
|
I am trying to write a script that when VIDEO INPUT 1 is active overlay #1 goes on air with 1.000ms delay but when the VIDEO INPUT 1 is out the transitions goes immediately out (not off). Code:do while true
Dim doc As New XmlDocument()
doc.LoadXml(API.Xml)
Dim root As XmlNode = doc.DocumentElement
' Select the node active input and fetch input number
Dim node As XmlNode = root.SelectSingleNode("/vmix/active")
Dim inputNumber as Integer = node.InnerXml
' Condition - if the current input number is equal to 1
If inputNumber <> 1 Then
API.Function("OverlayInput1Out",Input:=13)
Else
sleep(1000)
API.Function("OverlayInput1In",Input:=13)
End If
sleep(50)
Loop
As a begginer, I wrote this code based on many searches on this forum, but I am not beeing able to find this part. Can someone help?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: fva I am trying to write a script that when VIDEO INPUT 1 is active overlay #1 goes on air with 1.000ms delay
but when the VIDEO INPUT 1 is out the transitions goes immediately out (not off).
As a begginer, I wrote this code based on many searches on this forum, but I am not beeing able to find this part. Can someone help? Good effort for learning scripting but what is wrong wih just using a few triggers ? Quote:
but when the VIDEO INPUT 1 is out the transitions goes immediately out (not off).
OverlayInput1Off
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/17/2023(UTC) Posts: 12 Location: Rio de Janeiro
|
Quote:Good effort for learning scripting but what is wrong wih just using a few triggers ? I need to activate and deactivate this script for INPUT 01 from the companion app. I could not find a way to activate/deactivate triggers with companion. By my searches it is not possible. I read a post saying that creating a virtual input is the way to go, but in my case, all the shortcuts and Multiview is already set to INPUT 01. What I am trying to do is: If the program is live, overlayinput1 every time INPUT 1 is active. So If the program is not live I deactivate this script. This performs a cut and not a fade out as I would like using ```OverlayInput1Out```. But even with your suggestion the cut is happening after the ```sleep(1000)``` and this is what I am trying to prevent.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
So now it is related to companion use (ask in companion users groups or forums) ? You havent mentioned if what you want to put in overlay is a title ( with proper animation imbedded) or a regular input What are the transition effect settings for the overlays? Why if using triggers work (no need for a script) why the need to decativate them ? Why the need to deactivate the script ( if you insist on using one) ? If all the shortcuts and Multiview are already set to INPUT 01. why not use another one The more you try to explain the more confusing it seems to be becomming (and mixing terminology, triggers are not scripts) ! Can asure you this works just fine with a few triggers: Screenshot 2023-08-19 014100.jpg (47kb) downloaded 0 time(s).
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/17/2023(UTC) Posts: 12 Location: Rio de Janeiro
|
Originally Posted by: doggy 1) So now it is related to companion use (ask in companion users groups or forums) ?
2) You havent mentioned if what you want to put in overlay is a title ( with proper animation imbedded) or a regular input
3) What are the transition effect settings for the overlays?
4) Why if using triggers work (no need for a script) why the need to decativate them ?
5) Why the need to deactivate the script ( if you insist on using one) ?
6) If all the shortcuts and Multiview are already set to INPUT 01. why not use another one
7) The more you try to explain the more confusing it seems to be becomming (and mixing terminology, triggers are not scripts) !
Hello doggy, I will try to answer all your questions, maybe I can find a way to do what I want. 1) It is not related to companion. Companion or stream deck app was just a tool for me to activate the shortcut inside VMIX. 2) I want to overlay a title with a live clock in Overlay1. 3) Just a simple fade in and fade out. 4) I am running an one hour show on TV. I have around 30 inputs and 3 cameras. Whenever any of the 3 Cameras are on Program, I need the Live clock to be displayed in overlay1. If I transition to anything else other than the cameras, the show is not live, so I need this overlay to go out. The live clock is always on overlay1 because all the others overlay are being used. I also need it to be in overlay1 because I record this program without the LIVE CLOCK to be used another day. I tried setting up your triggers with "OnTransitionIn" and "OnTransitionOut" on the 3 cameras, but when I cut from one camera to the other, the overlay1 is deactivated (and it makes sense because of the trigger) 5) I was thinking about deactivating the script, because I can make a LIVE SHOW and also a RECORDED SHOW, so the script would make overlay1 active on Input 1, 2 and 3 (3 cameras) on a LIVE show, but on a RECORDED show, it would not turn overlay 1 ON. 6) I said that multiview is set to INPUT 1 because that is my main camera, and sometimes I need to use multiview with the show presenter (camera 1) and a guest via skype. This is also another problem with the triggers I used. If I set triggers on INPUT1 (camera 1) and I transition to a virtual set in INPUT10, the trigger to remove overlay1 on transition out will take effect. 7) I know triggers are not scripts, I was hoping to achieve what I wanted with a script because I wasnt getting it right with triggers.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/17/2023(UTC) Posts: 12 Location: Rio de Janeiro
|
After thinking for some days and reading many others forums, I saw someone making texts and images invisible.
So this is what I am thinking. I will put the 3 cameras on layer 4 inside a virtual set, I will add the triggers "OnTransitionIn" and "OnTransitionOut" to the virtual set input.
When the show is live, the text and images will be visible and when the show is recorded, I will set both to invisible.
I will test this tomorrow and hope it works well, the only problem is that I will not be able to use overlay 1 to anything else if needed.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/19/2020(UTC) Posts: 56 Location: London Thanks: 2 times Was thanked: 4 time(s) in 4 post(s)
|
Doggy alluded to, and I don't think you got his point, about the Overlay settings, in the bottom right of vMix.
Your Overlay 1 is probably set to Cut rather than Fade. If you set it to Fade, then 'OverlayInput1Out' will fade it in and out, rather than cutting it in and out.
I'm still a bit confused as to what you're trying to achieve and why it can't just be achieved with the triggers 'OnTransitionIn' and 'OnTransitionOut' on the input you want to bring an overlay in/out on.
And when you create the trigger you also define specifically what input it'll bring in/out on Overlay 1 too, meaning your overlay 1 would be free to use the 'rest of the show'.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/17/2023(UTC) Posts: 12 Location: Rio de Janeiro
|
Originally Posted by: Hypohamish Doggy alluded to, and I don't think you got his point, about the Overlay settings, in the bottom right of vMix.
Your Overlay 1 is probably set to Cut rather than Fade. If you set it to Fade, then 'OverlayInput1Out' will fade it in and out, rather than cutting it in and out.
I'm still a bit confused as to what you're trying to achieve and why it can't just be achieved with the triggers 'OnTransitionIn' and 'OnTransitionOut' on the input you want to bring an overlay in/out on.
And when you create the trigger you also define specifically what input it'll bring in/out on Overlay 1 too, meaning your overlay 1 would be free to use the 'rest of the show'. My overlay 1 in the bottom right is set to fade, and it is working fine. My case is that I have 3 cameras and it is set like this: Camera 01 (input 1) = 'OnTransitionIn > OverlayInput1 > Input Live Show' and 'OnTransitionOut > OverlayInput1Out > Input Live Show' Camera 02 (input 2) = 'OnTransitionIn > OverlayInput1 > Input Live Show' and 'OnTransitionOut > OverlayInput1Out > Input Live Show' Camera 03 (input 3) = 'OnTransitionIn > OverlayInput1 > Input Live Show' and 'OnTransitionOut > OverlayInput1Out > Input Live Show' When I cut from any other input to camera 1 (input 1) the overlay gets activated. When I cut from camera 01 (input 1) to camera 2 (input 2) the overlays gets deactivated because of camera 01 (input 1) trigger but it does not gets activated again with the trigger on input 2.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/23/2019(UTC) Posts: 556
Thanks: 62 times Was thanked: 130 time(s) in 118 post(s)
|
Originally Posted by: fva
My overlay 1 in the bottom right is set to fade, and it is working fine. My case is that I have 3 cameras and it is set like this: Camera 01 (input 1) = 'OnTransitionIn > OverlayInput1 > Input Live Show' and 'OnTransitionOut > OverlayInput1Out > Input Live Show' Camera 02 (input 2) = 'OnTransitionIn > OverlayInput1 > Input Live Show' and 'OnTransitionOut > OverlayInput1Out > Input Live Show' Camera 03 (input 3) = 'OnTransitionIn > OverlayInput1 > Input Live Show' and 'OnTransitionOut > OverlayInput1Out > Input Live Show'
When I cut from any other input to camera 1 (input 1) the overlay gets activated. When I cut from camera 01 (input 1) to camera 2 (input 2) the overlays gets deactivated because of camera 01 (input 1) trigger but it does not gets activated again with the trigger on input 2.
1) Put a delay to "OnTransitionIn" that is longer than the out transition of the overlay, but the Overlay will move out and in again on transitions between camera inputs. or 2) Remove the "OnTransitionOut" on the camera inputs and use it as "OnTransitionIn" on the other inputs. or 3) Describe your problem with your script from the first post better. I, at least, haven't understood the issue.
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Script on How to add delay to an overlay?
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