vMix Forums
»
General
»
General Discussion
»
Trigger at a time in a video playback
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
Is there a way to set up a trigger to perform an action at a specific time as a video played back during air?
I don't want to perform the action at the end of playback but rather at a specific time. .
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,285 Location: Belgium Thanks: 295 times Was thanked: 967 time(s) in 801 post(s)
|
Scripting will be in order
see "scripting for dummies post" , there is a script in there to do just that
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: doggy Scripting will be in order
see "scripting for dummies post" , there is a script in there to do just that Thx. I read that and the scripting documentation. It did not pop to me how it works or what variables I need to edit. I'll keep looking.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,285 Location: Belgium Thanks: 295 times Was thanked: 967 time(s) in 801 post(s)
|
Originally Posted by: NTSC
Thx. I read that and the scripting documentation.
It did not pop to me how it works or what variables I need to edit. I'll keep looking.
all you need to do is change the API.Function "action" ( any that is available also as shortcut) to whatever you want it to do when then https://forums.vmix.com/...ng-for-Dummies#post71985
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
You have been a member since:: 2/18/2014(UTC) Posts: 1,838 Location: Stockholm
Thanks: 144 times Was thanked: 297 time(s) in 250 post(s)
|
Depending on how many triggers you have for the video, you can delay the trigger to the point in the video to when you want it to kick in.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
Thanks. I just have one action. I want cut away from the video at :45 in.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
Just took the sample that Doggy wrote, and edited it so that with 40 seconds left in my video, it does a fly rotate to the preview.
It did not work :(
************************************************
' Checking time left of active input ' 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 = 40000 '40 seconds before end dim triggerduration as integer = 500 '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)
if Timeleft < triggertime
API.Function("FlyRotate",Input:=activeinput.tostring(),Value:="0," & triggerduration.tostring()) ' do whatever one wants to do
end if
sleep(500) Loop ******************************
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,285 Location: Belgium Thanks: 295 times Was thanked: 967 time(s) in 801 post(s)
|
Code:if Timeleft < triggertime
API.Function("FlyRotate",Input:="name or nr input to fly in")
sleep(1000)
end if
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/13/2010(UTC) Posts: 5,153 Location: Gold Coast, Australia Was thanked: 4349 time(s) in 1534 post(s)
|
Input.Preview.Function("FlyRotate") is what you need.
|
2 users thanked admin for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,285 Location: Belgium Thanks: 295 times Was thanked: 967 time(s) in 801 post(s)
|
Originally Posted by: admin Input.Preview.Function("FlyRotate") is what you need. Thanks, ignore my mail about API.Function("FlyRotate",Input:="Preview") not working ;-)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
Thanks! That worked perfectly - but now it keeps looping - I see at the end a LOOP command. How can I get a full stop in there?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,285 Location: Belgium Thanks: 295 times Was thanked: 967 time(s) in 801 post(s)
|
Originally Posted by: NTSC Thanks! That worked perfectly - but now it keeps looping - I see at the end a LOOP command. How can I get a full stop in there? Exit
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 4/6/2019(UTC) Posts: 95 Location: Florida Thanks: 10 times Was thanked: 13 time(s) in 11 post(s)
|
Change the mark-out point on the video, set a trigger to do something at the completion of the video. No real need to mess with scripting.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
Right...except I want the music from the video to be playing under my production after I cut away from it.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 4/6/2019(UTC) Posts: 95 Location: Florida Thanks: 10 times Was thanked: 13 time(s) in 11 post(s)
|
Originally Posted by: NTSC Right...except I want the music from the video to be playing under my production after I cut away from it. ah.. two actions then :) I do the same thing on an intro video, but instead of playing the embedded audio I load it as an audio file in vmix and marry the two with a trigger. When the video goes to output it plays, and simultaneously triggers the accompanying audio file (music). Once the video is done, it's triggered to fade to another input and the audio file keeps playing separately with no interruptions. Then I fade out the music on the midi controller. example: That way of doing it gives a lot of control on the fly
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
Yea, I considered trying that. You've inspired me to give it a try.
Thanks.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 4/6/2019(UTC) Posts: 95 Location: Florida Thanks: 10 times Was thanked: 13 time(s) in 11 post(s)
|
Originally Posted by: NTSC Yea, I considered trying that. You've inspired me to give it a try.
Thanks.
I think you'll find it's quite easy, maybe the only hard part is getting the audio file by itself. I was 'lucky' that the intro music was a normal song that was available on amazon music. Might be helpful to include some reset triggers so that when the video transitions out, it automatically resets to the mark-in position. Same with the audio file... fading it out and letting it finish, then it does its own trigger to reset upon completion. This way, if you play the video/audio sequence again later on, it will be ready. After I had forgotten to restart the audio after a test run, I decided to add that trigger. Nice little failsafe. If you need any help separating the audio I can do it in a few minutes, just send a download link to the video.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 5/3/2020(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
Thanks for the offer. I should be ok! Thank you so much for your help.
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Trigger at a time in a video playback
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