logo

Live Production Software Forums


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

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
timobr  
#1 Posted : Tuesday, June 2, 2020 11:41:41 PM(UTC)
timobr

Rank: Newbie

Groups: Registered
Joined: 6/2/2020(UTC)
Posts: 2
Australia
Location: Brisbane

Was thanked: 2 time(s) in 1 post(s)
Hi there,
I'm a fairly new user to vMix and looking for a way to display the remaining time left on a video through an output. During a live production when we cross between pre-recorded videos and a live camera it would be good to show the presenter a countdown clock to a piece of media so they know when they are back "live".

The best method we've been able to achieve is displaying a cropped and scaled multiview which seems to be the only place (other than the program) that shows the time remaining on a video.

Does anybody have any better solutions out there?

Thanks,
Tim
doggy  
#2 Posted : Tuesday, June 2, 2020 11:47:24 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: timobr Go to Quoted Post
a way to display the remaining time left on a video through an output.



Please do a search in tis forum as this has been addressed a few times and solved
it involves scripting and display it somewhere like a title . That in turn can be send to an output and as NDI signal etc

raugert  
#3 Posted : Friday, June 5, 2020 4:51:04 AM(UTC)
raugert

Rank: Advanced Member

Groups: Registered
Joined: 8/5/2017(UTC)
Posts: 569
Canada
Location: Manitoba

Thanks: 115 times
Was thanked: 313 time(s) in 178 post(s)
Have a look at Timecode Reader for Production Back Timing Reference in 3rd party apps.

https://forums.vmix.com/...on-Back-Timing-Reference
DWAM  
#4 Posted : Friday, June 5, 2020 5:32:29 AM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
thanks 2 users thanked DWAM for this useful post.
stigaard on 7/22/2020(UTC), Kristoph on 6/28/2021(UTC)
timobr  
#5 Posted : Friday, June 5, 2020 12:18:05 PM(UTC)
timobr

Rank: Newbie

Groups: Registered
Joined: 6/2/2020(UTC)
Posts: 2
Australia
Location: Brisbane

Was thanked: 2 time(s) in 1 post(s)
Thanks guys,
I found the Timecode Reader a bit buggy and needed to be opened in sequence and kept failing switching between videos. vMix Input Progress Monitor App looks promising but doesn't have a simple time remaining as an output.

Finally figured out how to get this script working which was posted elsewhere:

Originally Posted by: Xtreemtec Media Go to Quoted Post
So based on 2 programs above from Doggy,

I made a Video player time left title display that you can add on top of the Clock source by using the Multiview to stack upon.

While the code is not 100% perfect yet and only displays MM;SS But it gives you some idea and it's workable.

Till 60 seconds it's green, Turns then orange, and the last 10 seconds it's red.

Code:
' Checking time left of active running video and display this as an title. 
' and do some stuff at certain time remaining

dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim Timeleft as double = 0
dim triggertime as integer = 10      '10 seconds before end
dim triggerduration as integer = 2000   'fade duration, could be different than trigger

do while true

   dim xml as string = API.XML()
   dim x as new system.xml.xmldocument
   x.loadxml(xml)

activeinput = (x.SelectSingleNode("//active").InnerText)
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)

Timeleft= Double.Parse(duration)-Double.Parse(position)

Timeleft = Timeleft / 100

dim Timingleft as integer = CInt(Timeleft)
Timingleft = Timingleft / 10

dim Minutes as integer = Timingleft \ 60
dim Seconds as integer = Timingleft Mod 60

'used at debugging stage
  ' console.writeline(Timingleft)
  ' console.writeline(Seconds)

dim ThisTime as string 
ThisTime = Minutes.ToString("00") + ":" + Seconds.ToString("00")


if Timingleft < 60
   'put a response in a title and change color accordingly
  
    API.Function("SetText",Input:="Text Middle Centre Outline.gtzip",SelectedIndex:="0" ,Value:=Timingleft) ' Value:=":", Value:=Seconds)
   
    if Timingleft < 30 
       API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="red")
    else
       API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="orange")
    end if  
else
    API.Function("SetText",Input:="Text Middle Centre Outline.gtzip",SelectedIndex:="0" ,Value:=ThisTime)
    API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="green")
 end if


sleep(50)
Loop


Thanks doggy, never wanted to be 'that guy' that can't search the forum first. I did a bunch of google and YouTube searching before I came to the forums and couldn't find anything other than video countdowns.
thanks 2 users thanked timobr for this useful post.
Kristoph on 6/28/2021(UTC), studiodelta on 12/11/2022(UTC)
Pyrrhus  
#6 Posted : Wednesday, July 22, 2020 5:03:02 PM(UTC)
Pyrrhus

Rank: Newbie

Groups: Registered
Joined: 7/15/2020(UTC)
Posts: 7
United States

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
I'm new to the scripting side of things and don't understand how to get this to work. Would someone kindly point me in the right direction?Here are the steps I have taken.

1.) Went to Settings > Scripting > Add New Script
2.) I named the Script Countdown and pasted the code from Doggy.
3.) On the video I want to do the countdown on I added a trigger OnTransitionIn ScriptStart Countdown

From there I'm not sure what to do. I don't see anything being displayed. Am I supposed to create a new Title input? What is the syntax?


Originally Posted by: timobr Go to Quoted Post
Thanks guys,
I found the Timecode Reader a bit buggy and needed to be opened in sequence and kept failing switching between videos. vMix Input Progress Monitor App looks promising but doesn't have a simple time remaining as an output.

Finally figured out how to get this script working which was posted elsewhere:

Originally Posted by: Xtreemtec Media Go to Quoted Post
So based on 2 programs above from Doggy,

I made a Video player time left title display that you can add on top of the Clock source by using the Multiview to stack upon.

While the code is not 100% perfect yet and only displays MM;SS But it gives you some idea and it's workable.

Till 60 seconds it's green, Turns then orange, and the last 10 seconds it's red.

Code:
' Checking time left of active running video and display this as an title. 
' and do some stuff at certain time remaining

dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim Timeleft as double = 0
dim triggertime as integer = 10      '10 seconds before end
dim triggerduration as integer = 2000   'fade duration, could be different than trigger

do while true

   dim xml as string = API.XML()
   dim x as new system.xml.xmldocument
   x.loadxml(xml)

activeinput = (x.SelectSingleNode("//active").InnerText)
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)

Timeleft= Double.Parse(duration)-Double.Parse(position)

Timeleft = Timeleft / 100

dim Timingleft as integer = CInt(Timeleft)
Timingleft = Timingleft / 10

dim Minutes as integer = Timingleft \ 60
dim Seconds as integer = Timingleft Mod 60

'used at debugging stage
  ' console.writeline(Timingleft)
  ' console.writeline(Seconds)

dim ThisTime as string 
ThisTime = Minutes.ToString("00") + ":" + Seconds.ToString("00")


if Timingleft < 60
   'put a response in a title and change color accordingly
  
    API.Function("SetText",Input:="Text Middle Centre Outline.gtzip",SelectedIndex:="0" ,Value:=Timingleft) ' Value:=":", Value:=Seconds)
   
    if Timingleft < 30 
       API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="red")
    else
       API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="orange")
    end if  
else
    API.Function("SetText",Input:="Text Middle Centre Outline.gtzip",SelectedIndex:="0" ,Value:=ThisTime)
    API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="green")
 end if


sleep(50)
Loop


Thanks doggy, never wanted to be 'that guy' that can't search the forum first. I did a bunch of google and YouTube searching before I came to the forums and couldn't find anything other than video countdowns.


dmwkr  
#7 Posted : Thursday, July 23, 2020 1:02:16 AM(UTC)
dmwkr

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: Pyrrhus Go to Quoted Post
Am I supposed to create a new Title input?


You are already heading into the right direction. The script is reading the current position of the active input and - after doing the necessary calculations - outputting the remaining time to a title. The script does not create or add the title input, but it needs to know which title input to use.

Another step you should take, because the script runs in a loop: Stop it when you don't need it.

To get a better understanding of scripts the two main resources are:
https://forums.vmix.com/...86-Scripting-for-Dummies
https://www.vmix.com/hel...utFunctionReference.html
stigaard  
#8 Posted : Thursday, July 23, 2020 1:33:51 AM(UTC)
stigaard

Rank: Advanced Member

Groups: Registered
Joined: 5/20/2015(UTC)
Posts: 493
Man
Denmark
Location: Copenhagen, Denmark

Thanks: 389 times
Was thanked: 100 time(s) in 79 post(s)
As DWAM also commented, i have created a free utility app for vMix for this exact purpose. It is called vinproma, and is focused for users without scripting skills. You can download it on https://github.com/jensstigaard/vinproma/releases
and give it a try.
Pyrrhus  
#9 Posted : Thursday, July 23, 2020 4:21:53 AM(UTC)
Pyrrhus

Rank: Newbie

Groups: Registered
Joined: 7/15/2020(UTC)
Posts: 7
United States

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
In case anyone else searches for this topic and has questions, the piece that I was personally missing was adding a title by selecting GT Title and picking the one named "Text Middle Centre Outline" from the selection.

I was getting confused thinking that in

Quote:
API.Function("SetTextColour",Input:="Text Middle Centre Outline.gtzip",Value:="orange")


"Text Middle Centre" was a setting rather than the name of the actual Title. It's the spaces that was throwing me off, I thought the title was "Outline.gtzip" I personally use _ instead of a space and applied my own logic to this. Silly mistake.
Cyprian  
#10 Posted : Friday, August 28, 2020 11:15:02 AM(UTC)
Cyprian

Rank: Newbie

Groups: Registered
Joined: 5/9/2020(UTC)
Posts: 3
Canada
Location: Ottawa

This was very helpful everyone! Thank you this script worked for me!

However, I am having a hard time amending one thing. I would like the countdown timer to trigger not just on media files on their own but also on video media files when they are placed inside a virtual set (Blank, 4 layer) for example.

In the image attached you see that the video media is inside a layer, in this case Layer 2.

Can someone please point out what I have to add/change to the code so the countdown timer also actives when inside a virtual set layer.

Thank you kindly,

Cyprian
virtual set.png (579kb) downloaded 6 time(s).
jtr210  
#11 Posted : Friday, September 18, 2020 9:05:42 AM(UTC)
jtr210

Rank: Newbie

Groups: Registered
Joined: 8/6/2020(UTC)
Posts: 8
United States
Location: New York, NY

Originally Posted by: Cyprian Go to Quoted Post
This was very helpful everyone! Thank you this script worked for me!

However, I am having a hard time amending one thing. I would like the countdown timer to trigger not just on media files on their own but also on video media files when they are placed inside a virtual set (Blank, 4 layer) for example.

In the image attached you see that the video media is inside a layer, in this case Layer 2.

Can someone please point out what I have to add/change to the code so the countdown timer also actives when inside a virtual set layer.

Thank you kindly,

Cyprian
virtual set.png (579kb) downloaded 6 time(s).


This is the exact scenario I've been struggling with. I have tried the above approaches (amazing work by the way!), and they're really great, but the show I'm doing now wants all video to be played back in boxes/virtual inputs, and I can't ever get the timecode countdown to work with this. Does anyone know of an alternate approach to this dilemma? Thanks everybody!
Gunnar  
#12 Posted : Sunday, September 20, 2020 1:43:17 AM(UTC)
Gunnar

Rank: Advanced Member

Groups: Registered
Joined: 11/9/2018(UTC)
Posts: 56
Sweden
Location: Vårgårda

Thanks: 21 times
Was thanked: 2 time(s) in 1 post(s)
You can only nest 2 layers deep.
I had the same problem. When I have the the third nested layer it will not show up.
dmwkr  
#13 Posted : Thursday, September 24, 2020 8:00:41 AM(UTC)
dmwkr

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: jtr210 Go to Quoted Post

This is the exact scenario I've been struggling with. I have tried the above approaches (amazing work by the way!), and they're really great, but the show I'm doing now wants all video to be played back in boxes/virtual inputs, and I can't ever get the timecode countdown to work with this. Does anyone know of an alternate approach to this dilemma? Thanks everybody!


I'm far from an expert but I've tried to understand the basic concepts of scripts, with the help of this forum's resources. I can only encourage to try it, it's worth it. Without having tested it:

Line 17

Code:
activeinput = (x.SelectSingleNode("//active").InnerText)


is dynamically looking for the currently active input in the XML API. If you instead tell the script to look for one specific input (namely the List input or a mix input you use for playing out the videos to your mv), it might already be sufficient.

So a change of line 17 to

Code:
activeinput="6"


if input no. 6 is your list/mix input might do.
njfeathe85  
#14 Posted : Wednesday, January 13, 2021 3:39:12 AM(UTC)
njfeathe85

Rank: Member

Groups: Registered
Joined: 9/17/2020(UTC)
Posts: 18
United Kingdom
Location: Leeds

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
I have been looking at this thread this afternoon in order to get the time remaning of a VT to countdown. I've had my brother look at the code and help me edit it so it now shows 00:0# as it gets below 60s and then below 10s into single digits. We have added in "VT Time Remaining -" as well. There are also a few comments in there explaining to change the label for the title to the input label you have in your project.

The only thing we didn't get fully working was getting the script to stop once the countdown hit zero, it was working and then started doing something weird so I resorted to entering a stop script command on the streamdeck once the VT has finished and we fade to the next input. Hope this helps someone anyway!



' Checking time left of active running video and display this as an title.
' and do some stuff at certain time remaining

dim position as string = ""
dim duration as string = ""
dim activeinput as string = ""
dim Timeleft as double = 0
dim triggertime as integer = 10 '10 seconds before end
dim triggerduration as integer = 2000 'fade duration, could be different than trigger

dim DoLoop as boolean = true

do while DoLoop = true

dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)

activeinput = (x.SelectSingleNode("//active").InnerText)
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)

Timeleft= Double.Parse(duration)-Double.Parse(position)

Timeleft = Timeleft / 100

dim Timingleft as integer = CInt(Timeleft)
Timingleft = Timingleft / 10

dim Minutes as integer = Timingleft \ 60
dim Seconds as integer = Timingleft Mod 60

'used at debugging stage
' console.writeline(Timingleft)
' console.writeline(Seconds)

'Edit VT Time Remaining Label to suit
dim ThisTime as string
ThisTime = "VT Time Remaining - " + Minutes.ToString("00") + ":" + Seconds.ToString("00")


if Timingleft < 60
'put a response in a title and change color accordingly

'Change value of this variable to match the label of your input
dim TimeRemaining as string
TimeRemaining = "VT Time Remaining - 00:" + Seconds.ToString("00")

API.Function("SetText", Input:="vttimer.gtzip", SelectedIndex:="0", Value:=TimeRemaining)

if Timingleft < 30
API.Function("SetTextColour",Input:="vttimer.gtzip",Value:="red")
else
API.Function("SetTextColour",Input:="vttimer.gtzip",Value:="orange")
end if
else
API.Function("SetText",Input:="vttimer.gtzip",SelectedIndex:="0" ,Value:=ThisTime)
API.Function("SetTextColour",Input:="vttimer.gtzip",Value:="green")
end if


sleep(50)
Loop
doggy  
#15 Posted : Tuesday, January 19, 2021 2:52:08 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: njfeathe85 Go to Quoted Post
I've had my brother look at the code and help me edit it


Are you saying that even your brother doesn't know how to get out of a loop ?

so much fun to blindly copy code , change a few things and hope for the best ;-)
njfeathe85  
#16 Posted : Tuesday, January 19, 2021 3:38:32 AM(UTC)
njfeathe85

Rank: Member

Groups: Registered
Joined: 9/17/2020(UTC)
Posts: 18
United Kingdom
Location: Leeds

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
Hi

Really sorry and I hope i've not caused any offence, I figured with the code being shared that it was ok to share any adaptations.

I adapted the code to include a few labels etc and to also display as 00:00 which the original code did not do. My brother and I managed to get it to stop looping when it got to zero but it started doing somehting weird in VMIX where on some occasions the script would work and display correctly but other times not, so went back to the original adaptation.
ukfdb  
#17 Posted : Sunday, February 7, 2021 10:24:00 AM(UTC)
ukfdb

Rank: Newbie

Groups: Registered
Joined: 10/12/2020(UTC)
Posts: 2
United Kingdom
Location: East Grinstead

Thanks to all posting above, some very useful information here.

I'm struggling a little bit with one aspect - I've started with the script quoted above and tried modifying it but have got a little beyond my depth.

My issue is that my videos sometimes have out points marked and sometimes don't.

If I set the duration variable using

duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value) and there is an out point marked then the countdown will be wrong

If I set the duration using

duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markout").Value) then the countown works if an outpoint is marked but if not then the script crashes.

I've tried adding a lookup in the script to compare the two values and therefore choose the correct one (markout if set if not duration) but I can't seem to do it without causing the script to crash if markout is not set.

I tried this but it clearly isn't working. Any suggestions gratefully appreciated.

Code:
if 
String.IsNullOrEmpty(x.SelectSingleNode("//input[@number='"& activeinput &"']/@markOut").Value) 
then 
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markOut").Value)
else
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
end if


Thank you

James.



doggy  
#18 Posted : Sunday, February 7, 2021 12:06:42 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: ukfdb Go to Quoted Post


I'm struggling a little bit with one aspect - I've started with the script quoted above and tried modifying it but have got a little beyond my depth.




There are many tutorials regarding vb.net coding, all one has to do is a little google searching

The again this so called issue came up just a day ago in the "scripting for dummies" topic !

njfeathe85  
#19 Posted : Monday, February 8, 2021 10:33:55 PM(UTC)
njfeathe85

Rank: Member

Groups: Registered
Joined: 9/17/2020(UTC)
Posts: 18
United Kingdom
Location: Leeds

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: ukfdb Go to Quoted Post
Thanks to all posting above, some very useful information here.

I'm struggling a little bit with one aspect - I've started with the script quoted above and tried modifying it but have got a little beyond my depth.

My issue is that my videos sometimes have out points marked and sometimes don't.

If I set the duration variable using

duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value) and there is an out point marked then the countdown will be wrong

If I set the duration using

duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markout").Value) then the countown works if an outpoint is marked but if not then the script crashes.

I've tried adding a lookup in the script to compare the two values and therefore choose the correct one (markout if set if not duration) but I can't seem to do it without causing the script to crash if markout is not set.

I tried this but it clearly isn't working. Any suggestions gratefully appreciated.

Code:
if 
String.IsNullOrEmpty(x.SelectSingleNode("//input[@number='"& activeinput &"']/@markOut").Value) 
then 
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@markOut").Value)
else
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
end if


Thank you

James.





One thing to try could be to set up 3 scripts in total - one vt timer that runs when there is a in/out marked and another that runs when there is not an in/out marked. the final script would be a script including an if statement that looks at the active input number and then runs the appropriate script dependent on which input is active?

I was struggling to find away for the script vttimer script to stop so I setup a "vtstatus" script that runs the timer script (and turns on relevant multiview layers) if the active input matches my vt input number.

I use a list for VT's, this could get cumbersome if all vt's are seperate inputs.

alexjacobs  
#20 Posted : Wednesday, May 26, 2021 3:22:46 AM(UTC)
alexjacobs

Rank: Member

Groups: Registered
Joined: 8/11/2020(UTC)
Posts: 12

Was thanked: 1 time(s) in 1 post(s)
I don't suppose anybody would take pity on me as I learn and explain why the ampersands are around activeinput in the following lines?

Code:
duration = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@duration").Value)
position = (x.SelectSingleNode("//input[@number='"& activeinput &"']/@position").Value)
Users browsing this topic
Guest
2 Pages12>
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.