Rank: Newbie
Groups: Registered
Joined: 6/2/2020(UTC) Posts: 2 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: timobr 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/5/2017(UTC) Posts: 569 Location: Manitoba Thanks: 113 times Was thanked: 313 time(s) in 178 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 3/20/2014(UTC) Posts: 2,721 Location: Bordeaux, France Thanks: 243 times Was thanked: 794 time(s) in 589 post(s)
|
|
2 users thanked DWAM for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/2/2020(UTC) Posts: 2 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 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.
|
2 users thanked timobr for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 7/15/2020(UTC) Posts: 7 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 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 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.
|
|
|
|
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 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-Dummieshttps://www.vmix.com/hel...utFunctionReference.html
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/20/2015(UTC) Posts: 493 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/releasesand give it a try.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 7/15/2020(UTC) Posts: 7 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.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/9/2020(UTC) Posts: 3 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).
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 8/6/2020(UTC) Posts: 8 Location: New York, NY
|
Originally Posted by: Cyprian 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!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/9/2018(UTC) Posts: 56 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.
|
|
|
|
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 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 if input no. 6 is your list/mix input might do.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 9/17/2020(UTC) Posts: 18 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: njfeathe85 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 ;-)
|
|
|
|
Rank: Member
Groups: Registered
Joined: 9/17/2020(UTC) Posts: 18 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.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/12/2020(UTC) Posts: 2 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.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: ukfdb
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 !
|
|
|
|
Rank: Member
Groups: Registered
Joined: 9/17/2020(UTC) Posts: 18 Location: Leeds Thanks: 2 times Was thanked: 3 time(s) in 3 post(s)
|
Originally Posted by: ukfdb 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.
|
|
|
|
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)
|
|
|
|
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