countdown_timer_in_vmix
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
countdown_timer_in_vmix [2023/10/22 13:55] – peteraellig | countdown_timer_in_vmix [2023/10/27 08:48] (current) – peteraellig | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== CountDown Timer ===== | ===== CountDown Timer ===== | ||
- | There are countless ways to implement a countdown timer in vMix. But if you want a timer that changes color at certain times, displays an end text or counts up the overtime at 0, then here is a solution suggestion. Apart from vMix, nothing else is needed. In the end, the solution consists of 2 keyboard shortcuts and a script. The script generates its own timer. The variables in the script can be adjusted relatively easily. Since the script starts counting down immediately after starting, it needs another keyboard shortcut that resets the initial display. | + | Attention: this timer works only from vMix version 27. Must have something to do with the NET version somehow.\\ |
+ | There are countless ways to implement a countdown timer in vMix. But if you want a timer that changes color at certain times, displays an end text or counts up the overtime at 0, then here is a solution suggestion. Apart from vMix, nothing else is needed. In the end, the solution consists of 2 keyboard shortcuts and a script. The script generates its own timer. The variables in the script can be adjusted relatively easily. Since the script starts counting down immediately after starting, it needs another keyboard shortcut that resets the initial display. | ||
* 1. Create a keyboard shortcut, e.g. with the letter " | * 1. Create a keyboard shortcut, e.g. with the letter " | ||
{{:: | {{:: | ||
* 2. Create an second keyboard shortcut, with the same letter as in point 1 (" | * 2. Create an second keyboard shortcut, with the same letter as in point 1 (" | ||
{{:: | {{:: | ||
- | * 3. In the third shortcut, again with the same letter as the previous two shortcuts (" | + | * 3. In the third shortcut, again with the same letter as the previous two shortcuts (" |
{{:: | {{:: | ||
* 4. Create a fourth shortcut, e.g. with the letter " | * 4. Create a fourth shortcut, e.g. with the letter " | ||
Line 12: | Line 13: | ||
{{:: | {{:: | ||
- | Then go to the Settings of vMix to the Scripting section. There you create a new script with Add and name it Countdown. Pay attention to correct upper-lower case. Set the Local Script checkbox to true. In the Script Text zone copy the following code and confirm with OK. | + | Then go to the Settings of vMix to the Scripting section. There you create a new script with Add and name it Countdown. Pay attention to correct upper-lower case. Set the Local Script checkbox to true. In the Script Text zone copy the following code and confirm with Save. (see picture and code below)\\ |
+ | {{:: | ||
+ | |||
+ | Adjust the variables described in the code, such as total time, warning times, their colors or the end text. Also you can use the variable overtimestop to influence whether the timer stops at the end with a message or the countdown starts counting up the overtime.\\ | ||
+ | Lines with a ' sign at the beginning, are comments\\ | ||
+ | |||
< | < | ||
' | ' | ||
Line 26: | Line 33: | ||
' | ' | ||
'Timer length in minutes and seconds | 'Timer length in minutes and seconds | ||
- | Dim timerLengthMinutes As Integer = 1 | + | Dim timerLengthMinutes As Integer = 20 |
- | Dim timerLengthSeconds As Integer = 00 | + | Dim timerLengthSeconds As Integer = 30 |
' | ' | ||
Line 61: | Line 68: | ||
Dim currentTime As DateTime | Dim currentTime As DateTime | ||
API.Function(" | API.Function(" | ||
+ | |||
+ | 'put countdowntime in a dynamic value for resetting the timer | ||
+ | API.Function(" | ||
+ | |||
Do | Do | ||
Line 90: | Line 101: | ||
Dim timeLeft As TimeSpan = endTime - currentTime | Dim timeLeft As TimeSpan = endTime - currentTime | ||
' | ' | ||
+ | |||
+ | 'time display in vMix | ||
+ | if timeLeft.Tostring(" | ||
+ | Console.WriteLine(" | ||
+ | API.Function(" | ||
+ | else | ||
Console.WriteLine(" | Console.WriteLine(" | ||
- | 'time display in vMix | ||
API.Function(" | API.Function(" | ||
+ | end if | ||
+ | |||
'waits 200 miliseconds | 'waits 200 miliseconds | ||
sleep(200) | sleep(200) | ||
Loop While True | Loop While True | ||
- | + | </ | |
- | + | Finally, load the title into your vMix as used in the example. You can download the title here. I have also provided the whole thing as a bundle for download or the preset alone, which already contains the shortcuts and the script.\\ | |
- | + | Loading with the Bundle option includes everything and also loads scripts and shortcuts.\\ | |
- | + | [[https:// | |
- | </ | + | \\ |
+ | DynamicValue also makes it easy to adjust the countdown times. With a streamdeck pad you could enter different times in Dynamicvalue and the script could then take the coutdown time from there. | ||
countdown_timer_in_vmix.1697975704.txt.gz · Last modified: by peteraellig