Graphics

 View Only
  • 1.  Using the end of a video file as a trigger

    Posted 12-14-2023 06:12

    Hi there,

    I would like to use a video file to trigger an event. 

    To be more specific, I would like the event to be triggered by the ending point of the video file. 

    The length of this video file changes every week so the idea is to overwrite it in the video folder and let the magic happen without touching the timeline.

     Is this possible?

    Thanks beforehand for your answer.

    Régis



    ------------------------------
    Régis Blank
    TELEBASEL
    ------------------------------


  • 2.  RE: Using the end of a video file as a trigger

    Posted 12-15-2023 11:57

    I dont know if what you are trying to do directly is possible. - You could have other triggers via like a text box or something in order to type in the number of frames until trigger. - But without placing the video in the scene director each time, which would be more work than just moving the trigger, I am unsure.

    This is just me thinking out loud. - I know that you can set a video material for the length of the scene director to change based on the length of the video. - I am not sure if there is a visual logic block for the length of a video. - But I would guess that there might be scripting that you could do to get the length of video on online, and then that length copy its text to a text block, and then that text block drive a script to send a scene trigger.

    That is all just thinking out loud and typing in a string of thought.



    ------------------------------
    Garrett Hall
    Overtime Elite
    ------------------------------



  • 3.  RE: Using the end of a video file as a trigger

    Posted 12-15-2023 12:18

    Thanks for the reply, this gave me an idea. 

    Best regards



    ------------------------------
    Régis Blank
    TELEBASEL
    ------------------------------



  • 4.  RE: Using the end of a video file as a trigger

    Posted 12-15-2023 12:06

    I don't have time to try this, but here's an idea to try.

    Use scripting to get the length of the video.

    https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.mediaplayer.naturalduration?view=windowsdesktop-8.0

    Haven't found a VB version of this.

    Also, xpVideoShader has an OutPoint property. Same as length?

    Once you have the length, design a pause. Maybe create a timestamp for when it starts playing then a loop that checks the difference between current time and the timestamp against the video length. I don't know if you can create a pause event with Engine, but that would be the easiest.

    Hope this helps.



    ------------------------------
    Azathoth
    Son of Cthulhu
    ------------------------------



  • 5.  RE: Using the end of a video file as a trigger

    Posted 12-15-2023 12:23

    As I'm not a scripting person, I'll have to ask our programmer for this. thanks a lot!



    ------------------------------
    Régis Blank
    TELEBASEL
    ------------------------------



  • 6.  RE: Using the end of a video file as a trigger

    Posted 01-02-2024 09:19

    Hi there!

    This can indeed be done with some scripting and VB.
    If you look through the Xpression SDK, and under the xpMaterial Object, there is a "Duration Property". This can be used in a scene director script event for example to look at the material of a quad, get the length of the material, and then move another trigger in the scene director to match the length of the clip in the material.

    I cant give you the exact code now, but if I find the project where I tested this I'm sure I could give you a few more pointers.



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------



  • 7.  RE: Using the end of a video file as a trigger

    Posted 01-02-2024 10:55

    Awesome. I was looking for that for this post.



    ------------------------------
    Azathoth
    Son of Cthulhu
    ------------------------------



  • 8.  RE: Using the end of a video file as a trigger

    Posted 01-02-2024 15:42

    I think this is an example of the script being discussed. 

    Notes from change log and SDK about xpMaterial.Duration:

    [implemented] xpMaterial.Duration read only property which returns the duration in frames of the material (returns the longest duration of any used shader)

    The duration of a material is controlled by the shaders it contains.  For example the duration of a material containing a video clip would be the duration of the video clip.  Materials without video clips would generally have no duration.

    Dim track as xpSceneDirectorTrack

    Dim clip as xpSceneDirectorClip

     

    Dim obj as xpBaseObject

    Dim mat as xpMaterial

     

    Self.GetObjectByName(“objectname”, obj)

    Obj.getmaterial(0,mat)

     

    Self.scenedirector.GetTrackByName(“track2”, track)

    Track.GetClipByName(“event1”, clip)

    Clip.position = mat.duration




  • 9.  RE: Using the end of a video file as a trigger

    Posted 01-02-2024 19:55

    Yup! That's the one I was referring to!

    Can confirm it works as well. I am using it for live arena production where we never know how long a video is. Works like a charm, triggering a scene director for animation out when the clip has 5 frames left of play time. 



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------



  • 10.  RE: Using the end of a video file as a trigger

    Posted 01-30-2024 11:08

    Many thanks to all of you!

    I tried to script by myself but my limits where reached very quickly. Today our programmer helped me and it finally works. 

    Now all we have to do is to overwrite the avi clip every week and at its end the graphics automatically move out.

    This is great! Thanks again.



    ------------------------------
    Régis Blank
    TELEBASEL
    ------------------------------