vMix Forums
»
General
»
General Discussion
»
Making Countdown/Timer only display in seconds
Rank: Newbie
Groups: Registered
Joined: 3/11/2021(UTC) Posts: 8
|
Hi everyone.
I'm trying to create a timer that only displays the timer/countdown in seconds. Is this possible?
I see that the Display Format allows you to add the timer as HH:mm, HH:mm:ss, ss and a few others. But I'd love it to be "ssss" as I need to display seconds from 0 to 5000 continuously
Can this be done, through countdown or with scripts?
|
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,482  Location: Belgium Thanks: 314 times Was thanked: 1018 time(s) in 836 post(s)
|
|
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 1/25/2019(UTC) Posts: 327  Thanks: 23 times Was thanked: 82 time(s) in 62 post(s)
|
if you only want to display seconds, counting up, there is a very simple solution make a new script copy this in: Code:dim second as integer =0
do while true
API.Function("SetText",Input:="Title 0- The Classic Blue.gtzip",SelectedIndex:="1" ,Value:=second)
second = second + 1
sleep (1000)
loop
load the Title Title 0- The Classic Blue.gtzip from the predefined Titles. start the script the script passes the value to the Title and puts it in the first field. to stop or reset the time, some coding is needed again. To implement more complex time displays, follow the link in doggy's post.
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/11/2021(UTC) Posts: 8
|
Originally Posted by: doggy  Cheers that makes sense. Thanks for your help Doggy your help is much appreciated!
|
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,482  Location: Belgium Thanks: 314 times Was thanked: 1018 time(s) in 836 post(s)
|
As peter1000's answer is the basic way to go , but if you want to play with date/time data and some formatting (not just for counting up seconds) ;-) Code:dim StartTime as DateTime
Dim ts As TimeSpan
Dim NowTime As DateTime
do while true
StartTime = DateTime.Now()
dim total as integer = 0
do while total < 10
NowTime = DateTime.Now()
ts = NowTime.Subtract(StartTime)
total = ((ts.Hours * 60) + ts.Minutes) * 60 + ts.Seconds
API.Function("SetText",Input:="sometitle.gtzip",SelectedName:="Headline.Text",Value:=string.Format("T:{0,4}",total))
'console.writeline((string.Format("T:{0,4}", total)))
sleep(1000)
Loop
Loop
|
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,482  Location: Belgium Thanks: 314 times Was thanked: 1018 time(s) in 836 post(s)
|
;-)Code:API.Function("SetText",Input:="greenmod.gtzip",SelectedName:="Headline.Text",Value:="0")
Do while true
sleep(1000)
API.Function("SetText",Input:="greenmod.gtzip",SelectedName:="Headline.Text",Value:="+=1")
Loop
|
 1 user thanked doggy for this useful post.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 2/2/2015(UTC) Posts: 172 Location: NL
Thanks: 182 times Was thanked: 20 time(s) in 17 post(s)
|
I modified the script that was posted just above, so that it used tenths of a second; API.Function("SetText",Input:="timecode.gtzip",SelectedName:="Headline.Text",Value:="0,0") Do while true sleep(100) API.Function("SetText",Input:="timecode.gtzip",SelectedName:="Headline.Text",Value:="+=0,1") Loop It does run. However, the timing is not accurate. After about 5 minutes, the time indicated in the vMix title is 3 seconds behind. (checked with the stopwatch on my phone) Not much else was running on the machine. Maybe the script does produce accurate timing for full seconds, I did not test this (we need the decimals). We'll look at a different solution. First idea is using a URL as a vMix input, e.g. https://www.estopwatch.net
|
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,482  Location: Belgium Thanks: 314 times Was thanked: 1018 time(s) in 836 post(s)
|
Originally Posted by: Ario  I modified the script that was posted just above, so that it used tenths of a second; API.Function("SetText",Input:="timecode.gtzip",SelectedName:="Headline.Text",Value:="0,0") Do while true sleep(100) API.Function("SetText",Input:="timecode.gtzip",SelectedName:="Headline.Text",Value:="+=0,1") Loop It does run. However, the timing is not accurate. After about 5 minutes, the time indicated in the vMix title is 3 seconds behind. (checked with the stopwatch on my phone) Not much else was running on the machine. Maybe the script does produce accurate timing for full seconds, I did not test this (we need the decimals). We'll look at a different solution. First idea is using a URL as a vMix input, e.g. https://www.estopwatch.net You need to use a correct reference time and not just hoping a counting up will be accurate over time hence the use of DATETIME for example
|
|
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Making Countdown/Timer only display in seconds
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