vMix Forums
»
General
»
General Discussion
»
Going from recording to live using the API
Rank: Member
Groups: Registered
Joined: 1/2/2014(UTC) Posts: 25 Location: india
Thanks: 1 times
|
Is there any way to tell when a recording has stopped playing via the API? I want to return to live broadcast when a series of recordings have finished. I need to know either way so I can either do it - or stop trying, Thanks in advance.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/13/2014(UTC) Posts: 5 Location: Sweden Was thanked: 2 time(s) in 2 post(s)
|
Hi, I believe that's possible. I wouldn't say completely from the API, but kind of. When an empty request is sent to vMix, it responds with a very useful XML-file containing lots of useful things about the what's in vMix for you to play with. Below is a snippet from the XMl-file, displaying one of my inputs in my example project. Code:
<input key="035d71ae-c1f6-4efc-93c3-ce634e253d41" number="4" type="Video" title="myVideo.MP4" state="Running" position="25630" duration="629200" muted="False" loop="False">myVideo.MP4</input>
What you're looking for is the "state" attribute, which tells you whether the input is "Running" or is "Paused". With this information you can do lots of things! For example you could once a second or so send empty requests to vMix to check if the state still is "Running", or if it's "Paused". Though this might be bad performance wise. If I'd do something of the sorts, I'd take the duration of the video, subtract that with the position (both are displayed in seconds), let a timer go in the background and after the amount of seconds send the request to change the active input to the live broadcast instead. The second solution should work for a series of recordings as well, but then you'd have to combine the durations of each video file. (I haven't used playlists, but I suppose you might get the total duration of that as well?) With this you could also create a kind of custom playlist app if you'd want that. Hope this help! /Kristoffer
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/13/2010(UTC) Posts: 5,208 Location: Gold Coast, Australia Was thanked: 4288 time(s) in 1520 post(s)
|
If you don't have to use the API, here is a way using Triggers:
1. Create a List with all the videos you would like to play. 2. In the List Input Properties under the Triggers tab add a OnCompletion trigger to fade to whatever input you like.
Regards,
Martin vMix
|
|
|
|
Rank: Member
Groups: Registered
Joined: 1/2/2014(UTC) Posts: 25 Location: india
Thanks: 1 times
|
Really helpful - thank you very much.
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Going from recording to live using the API
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