logo

Live Production Software Forums


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

Notification

Icon
Error

Options
Go to last post Go to first unread
Riddlez  
#1 Posted : Saturday, May 29, 2021 1:00:58 PM(UTC)
Riddlez

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?
doggy  
#2 Posted : Saturday, May 29, 2021 4:43:48 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 314 times
Was thanked: 1018 time(s) in 836 post(s)
Time formats follow the normal time rules

Script will do that for you

https://www.google.com/s...wAhUKahQKHYmcBoYQ4dUDCA4
Peter1000  
#3 Posted : Saturday, May 29, 2021 5:40:46 PM(UTC)
Peter1000

Rank: Advanced Member

Groups: Registered
Joined: 1/25/2019(UTC)
Posts: 327
Switzerland

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.
Riddlez  
#4 Posted : Saturday, May 29, 2021 6:00:12 PM(UTC)
Riddlez

Rank: Newbie

Groups: Registered
Joined: 3/11/2021(UTC)
Posts: 8

Originally Posted by: doggy Go to Quoted Post
Time formats follow the normal time rules

Script will do that for you

https://www.google.com/s...wAhUKahQKHYmcBoYQ4dUDCA4


Cheers that makes sense. Thanks for your help Doggy your help is much appreciated!

doggy  
#5 Posted : Saturday, May 29, 2021 6:49:17 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,482
Belgium
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
doggy  
#6 Posted : Saturday, May 29, 2021 7:01:48 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,482
Belgium
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
thanks 1 user thanked doggy for this useful post.
Ario on 3/3/2026(UTC)
Ario  
#7 Posted : Tuesday, March 3, 2026 6:20:02 PM(UTC)
Ario

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
doggy  
#8 Posted : Tuesday, March 3, 2026 7:17:18 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 314 times
Was thanked: 1018 time(s) in 836 post(s)
Originally Posted by: Ario Go to Quoted Post
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
Users browsing this topic
Guest (2)
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.