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
knbPixels  
#1 Posted : Tuesday, May 14, 2024 2:13:06 AM(UTC)
knbPixels

Rank: Advanced Member

Groups: Registered
Joined: 2/7/2024(UTC)
Posts: 71
United States

Thanks: 7 times
Was thanked: 5 time(s) in 5 post(s)
I believe currently that the time remaining being reported to Companion and available there as a variable is just a text string. Therefore we can't use it to do anything, we can only use it to display the TR on a button. But if the TR could be available to Companion in a way that can be interpreted as functional timecode of sorts, then we can use the time remaining to trigger actions in Companion.


Alternatively, I would love the trigger functions in vMix to be expanded to include not only "OnCountdownCompleted", But also "OnCountdownTime" and then the options for greater than, less than, and equals to a countdown timer reaching a specific mark.
nikosman88  
#2 Posted : Tuesday, May 14, 2024 5:23:55 AM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 496
Greece
Location: athens

Thanks: 121 times
Was thanked: 70 time(s) in 66 post(s)
Hello. If i understand well what you need to do. Go to companion-->add trigger-->events-->add event-->on condition becoming true-->condition-->internal:variable: check value and in this value you can add vmix remaining time to do something
knbPixels  
#3 Posted : Tuesday, May 14, 2024 5:26:26 AM(UTC)
knbPixels

Rank: Advanced Member

Groups: Registered
Joined: 2/7/2024(UTC)
Posts: 71
United States

Thanks: 7 times
Was thanked: 5 time(s) in 5 post(s)
Originally Posted by: nikosman88 Go to Quoted Post
Hello. If i understand well what you need to do. Go to companion-->add trigger-->events-->add event-->on condition becoming true-->condition-->internal:variable: check value and in this value you can add vmix remaining time to do something


That’s what I originally tried. As I mentioned, that variable check is for time remaining of playback items I believe. I couldn’t get it to work. If anyone else is able to get it to work I’d be interested in learning more, but a countdown clock isn’t an item that has a timeline to reference
nikosman88  
#4 Posted : Tuesday, May 14, 2024 6:41:59 AM(UTC)
nikosman88

Rank: Advanced Member

Groups: Registered
Joined: 12/24/2021(UTC)
Posts: 496
Greece
Location: athens

Thanks: 121 times
Was thanked: 70 time(s) in 66 post(s)
Originally Posted by: knbPixels Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
Hello. If i understand well what you need to do. Go to companion-->add trigger-->events-->add event-->on condition becoming true-->condition-->internal:variable: check value and in this value you can add vmix remaining time to do something


That’s what I originally tried. As I mentioned, that variable check is for time remaining of playback items I believe. I couldn’t get it to work. If anyone else is able to get it to work I’d be interested in learning more, but a countdown clock isn’t an item that has a timeline to reference

Yes it is for playback items. But a way to possible do something like you need
Vmix recognises the countdown templates at externally as text change. I believe with scripting you can do what you need in internal way. For now and for companion if you need to do something on a x time of the countdown try to the value in the trigger to setup like = -->the time you need to do something at the layer text of your countdown gtzip file. As value select the layer that has the countdown text change. For example for the timer called "timer centre.gtzip" in the value in the trigger you will find the "timer centre.gzip layer 0 title text" and then = -->you write the text (time) you need to do something
knbPixels  
#5 Posted : Tuesday, May 14, 2024 6:58:43 AM(UTC)
knbPixels

Rank: Advanced Member

Groups: Registered
Joined: 2/7/2024(UTC)
Posts: 71
United States

Thanks: 7 times
Was thanked: 5 time(s) in 5 post(s)
Originally Posted by: nikosman88 Go to Quoted Post
Originally Posted by: knbPixels Go to Quoted Post
Originally Posted by: nikosman88 Go to Quoted Post
Hello. If i understand well what you need to do. Go to companion-->add trigger-->events-->add event-->on condition becoming true-->condition-->internal:variable: check value and in this value you can add vmix remaining time to do something


That’s what I originally tried. As I mentioned, that variable check is for time remaining of playback items I believe. I couldn’t get it to work. If anyone else is able to get it to work I’d be interested in learning more, but a countdown clock isn’t an item that has a timeline to reference

Yes it is for playback items. But a way to possible do something like you need
Vmix recognises the countdown templates at externally as text change. I believe with scripting you can do what you need in internal way. For now and for companion if you need to do something on a x time of the countdown try to the value in the trigger to setup like = -->the time you need to do something at the layer text of your countdown gtzip file. As value select the layer that has the countdown text change. For example for the timer called "timer centre.gtzip" in the value in the trigger you will find the "timer centre.gzip layer 0 title text" and then = -->you write the text (time) you need to do something



Yeah, and as with most things there are generally ways to accomplish things that you need to in vMix, and work around the problem...but that doesn't mean that the feature shouldn't exist. Appreciate your help, but because all workarounds to this problem are cumbersome, that's the reason for the request...to make something easy that is not so easy.
Roy Sinclair  
#6 Posted : Tuesday, May 14, 2024 9:16:22 AM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 post(s)
Originally Posted by: knbPixels Go to Quoted Post
I believe currently that the time remaining being reported to Companion and available there as a variable is just a text string. Therefore we can't use it to do anything, we can only use it to display the TR on a button. But if the TR could be available to Companion in a way that can be interpreted as functional timecode of sorts, then we can use the time remaining to trigger actions in Companion.


Alternatively, I would love the trigger functions in vMix to be expanded to include not only "OnCountdownCompleted", But also "OnCountdownTime" and then the options for greater than, less than, and equals to a countdown timer reaching a specific mark.


Use your OWN countdown in a script that can then do everything you need it to do at the appropriate time and in my case supports the countdown in a the one fashion not supported by the native countdown.

Code:

'Countdown to Service start Script

' vMix Inputs - All will be referenced using their unique "key" (GUID) which will only change if the input is deleted and then added again, otherwise changing the name or input number will not affect this script
Dim WhichCountdownScreen() as string = {"17abeafe-9243-45a7-879d-94491046b873","b843684a-de64-4b1f-9fd9-bee3316c47c9"}
Dim CountdownScreen as string
Dim WhichCountdownTitle() as string = {"3e500d73-872c-4841-aa5c-67ebbf46d486","610f7530-72ff-4449-9180-cd4f9d0a4dc2"}
Dim CountdownTitle as string
Dim CountdownTitleText as string 
Dim CountdownBackgroundMusic as string = "d34761a6-5c99-4bbd-acb8-6e4561d31eaf"
Dim AudioFeedFromSoundBoard as string = "57d87e62-8130-4b7a-a893-741d6c6c6472"
Dim SongCaptionsFromLaptop as string = "d257b307-e475-4aa9-abe6-6f03e9684d57"		
Dim AnnouncementsFromLaptop as string = "5b5a4a6e-6f12-41ec-9bf0-0b5b29886be3" 	
Dim AnimatedLogo as string = "0f22c6b3-626f-40ef-910c-1b406ca55cd1"
Dim LiveOutput as string = "a961fbe3-55d7-40d9-bbd5-33922aa60a3f"

API.Function("ScriptStart","","BugOnBugOff")		' No key (GUID) for scripts in vMix 

' Sunday Service begins in {0:10:00 AM|mm:ss}

Dim ServiceTime as string
Dim StreamingStartTime as string
Dim DayOfWeek as string = DateTime.Now.ToString("ddd") 

Dim dtServiceTime as DateTime
Dim dtStreamingStartTime as DateTime 

If DayOfWeek = "Sun" Then
	CountdownScreen = WhichCountdownScreen(0)
	CountdownTitle = WhichCountdownTitle(0)
	CountdownTitleText = "Sunday Service begins in "
	dtServiceTime = new DateTime(Datetime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ,10,00,00)
	dtStreamingStartTime = new DateTime(Datetime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ,09,45,00)
End If
'  ----------------- Testing time AT the moment
If DayOfWeek = "Sat" Then
	CountdownScreen = WhichCountdownScreen(0)
	CountdownTitle = WhichCountdownTitle(0)
	CountdownTitleText = "Sunday Service begins in "
	dtServiceTime = new DateTime(Datetime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ,15,33,00)
	dtStreamingStartTime = new DateTime(Datetime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ,15,30,00)
End If
If DayOfWeek = "Wed" Then
	CountdownScreen = WhichCountdownScreen(1)
	CountdownTitle = WhichCountdownTitle(1)
	CountdownTitleText = "Wednesday night Bible Study begins in "
	dtServiceTime = new DateTime(Datetime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 18,30,00)				' yyyy,mm,dd,hh,mm,ss - 24 hour time
	dtStreamingStartTime = new DateTime(Datetime.Now.Year,DateTime.Now.Month, DateTime.Now.Day, 18,20,00)
End If

StreamingStartTime = dtStreamingStartTime.ToString("hh:mm")
ServiceTime = dtServiceTime.ToString("hh:mm")
console.writeline ( "ServiceTime=" & ServiceTime & " Stream starting time=" & StreamingStartTime & " Current time=" & DateTime.Now.ToString("hh:mm"))
API.Function("Restart",CountdownBackgroundMusic)
API.Function("Play",CountdownBackgroundMusic)
API.Function("CutDirect",CountdownScreen)
API.Function("AudioOff",AudioFeedFromSoundBoard)
API.Function("AudioOn",CountdownBackgroundMusic)
API.Function("ActiveInput",Mix:=3,Input:=CountdownScreen)


API.Function("OverlayInput3Off")				' Make sure that we don't have the Slideshow coming up in the "Song lyrics" overlay zone


'		Main timer Loop
'
'			We check for everything that needs to happen during the countdown in this loop:
'				1.	End of the countdown
'				2.	Time to start streaming (15 mins before end of countdown as of this comment being written)
'

Do While True
	If ServiceTime = DateTime.Now.ToString("hh:mm") Then
		' The times match so exit the loop!
		Exit do
    End If
    If StreamingStartTime = DateTime.Now.ToString("hh:mm") Then
		' Time to start the streaming
		API.Function("StartStreaming","0")
	End If
	' Here we will update the countdown time in the "HeadlineText" of the countdown screen
	
	Dim tsHowLong as TimeSpan = dtServiceTime - DateTime.Now
	Dim stHowLong as String = tsHowLong.ToString.Substring(0,8)
	If stHowLong.Substring(0,2) = "00" Then
		stHowLong = stHowLong.Substring(3,5)
	End If
	API.Function("SetText",Input:=CountdownTitle,SelectedName:="Headline.Text",Value:= CountdownTitleText & stHowLong)
	'console.writeline("Time Left = " & TimeLeft & " Hours left " & Hoursleft & " Minutes left " & CStr(MinutesLeft) & " Seconds left " & Secondsleft)
	sleep(1000)  ' Sleep for one second
Loop

Console.writeline("Starting service")
API.Function("AudioOff",CountdownBackgroundMusic)
API.Function("Pause",CountdownBackgroundMusic)
API.Function("AudioOn",AudioFeedFromSoundBoard)
API.Function("StartRecording")
API.Function("ActiveInput",Mix:=3,Input:=AnnouncementsFromLaptop)
API.Function("CutDirect",AnimatedLogo)

'  Because I often forget to turn it on we'll wait one minute while Powerpoint is exited and ProPresenter is turned on then display the song subtitles
'  of course that assumes someone remembers to get the Laptop ready for the song service --- but we only do this on Sunday, not Wednesday

If DayOfWeek = "Sun" Then
	sleep(60000) ' Wait one Minute
	API.Function("OverlayInput3In",SongCaptionsFromLaptop)  ' Don't use the toggle API option, use the IN option just in case it IS remembered to turn it on. We don't want to turn it off if it is on.
End If


This is a working example you can use to create your own custom countdown.

knbPixels  
#7 Posted : Tuesday, May 14, 2024 9:28:29 AM(UTC)
knbPixels

Rank: Advanced Member

Groups: Registered
Joined: 2/7/2024(UTC)
Posts: 71
United States

Thanks: 7 times
Was thanked: 5 time(s) in 5 post(s)
Thanks Roy, please see my previous response as it applies to your method as well
Users browsing this topic
Guest
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.