Graphics

 View Only
Expand all | Collapse all

Building a pause into a movie file

  • 1.  Building a pause into a movie file

    Posted 07-12-2015 17:56
    We have a countdown clock going from 30 to 0. It is a movie file with audio. Is there a way to pause it when needed? For instance, if I need to pause it at 27, 14, etc.?


  • 2.  RE: Building a pause into a movie file

    Posted 07-12-2015 22:52
    Yes, just drag the video material onto the scenedirector instead of using "autostart" and "freerunning". Then you can put pause events anywhere you want on the scene director tracks.

    #XPression


  • 3.  RE: Building a pause into a movie file

    Posted 07-12-2015 23:05
    Thank you for your response Brian, but the pause does not occur at the same point in the scene director. It is for a trivia question and as soon as the talent answers the question, I want to pause the clock. Any thoughts?

    #XPression


  • 4.  RE: Building a pause into a movie file

    Posted 07-13-2015 00:20
    Do a search on this forum for the post called "Video playback (Studio 2ch V5.5)" and you will find the solution..

    You need to create a script and attach it to a keyboard button shortcut that can pause or resume the video clip.

    (In this case you would not want to have the video on the scene director, but rather would use the autostart/freerunning properties in the shader).

    #XPression


  • 5.  RE: Building a pause into a movie file

    Posted 07-13-2015 20:16

    So this is the script I found. I removed the movie from the scene director and edited the movie in the Run Mode as follows: Mode: Play Once, Auto Start is selected, Free Running is selected. I added the script



    dim ch as xpOutputFramebuffer

    dim scene as xpScene

    dim obj as xpBaseObject

    dim mat as xpMaterial

    Engine.GetOutputFramebuffer (0, ch)

    ch.GetSceneOnLayer(0, scene)

    scene.getObjectByName("Quad1"³, obj)

    obj.GetMaterial(0, mat)

    mat.play



    Direct access shortcut is alt+F12, Quickmenu key is P

    It is still not working. Could you tell me what I'm doing wrong?


    #XPression


  • 6.  RE: Building a pause into a movie file

    Posted 07-13-2015 20:18
    If you are trying to pause it, you should change the line from `mat.play` to `mat.pause`.

    #XPression


  • 7.  RE: Building a pause into a movie file

    Posted 07-13-2015 20:19
    And did you assign the material to an object called "Quad1"? That is what your script is assuming the object is called.

    #XPression


  • 8.  RE: Building a pause into a movie file

    Posted 07-13-2015 20:25
    Sorry, you probably also want to turn off Free-running (and maybe autostart too).. I'm not sure why I was thinking in my previous reply that you should turn them on..

    The script also assumes the scene is on Framebuffer 1 Layer 0, so make sure that is where your sequencer is sending it when you put it online. I just tried the script here and it's working ok for me.. I made two shortcuts, one using `mat.play` and the other is the same but has `mat.pause` so I could stop and start the material on demand.

    #XPression


  • 9.  RE: Building a pause into a movie file

    Posted 07-13-2015 21:51
    I did assign the material to an object called Quad1. I will try the other steps after my show is over. Thank you.

    #XPression


  • 10.  RE: Building a pause into a movie file

    Posted 07-14-2015 02:35
    Mark, did you get this working? I thought this would be a good thing to have in my toolbox... but it's not working for me as well. @Brian, I looked up the original post followed the instructions there... I also followed the above instructions and it still doesn't work.

    I'm running Xpression - v5.9 build 3154. My video material is "Play Once", "Auto Start" (when I deselect Auto Start, the video doesn't even play from my sequencer). My quad is named Video. I changed the script to get the quad named "Video". I compiled the script in the keyboard mapping section and got the Green Checkmark that my script was OK. Unfortunately it's still not working for me... Not sure what I'm doing wrong...

    #XPression


  • 11.  RE: Building a pause into a movie file

    Posted 07-14-2015 02:39
    Hi Steve, I will make a video tutorial tomorrow to show how it's done.. There must be a small detail missing from the instructions maybe..

    #XPression


  • 12.  RE: Building a pause into a movie file

    Posted 07-14-2015 02:45
    Thanks Brian, let me apologize in advance if it's some SPACE or CAPITAL LETTER that i have missed... lol... I appreciate the help....

    #XPression


  • 13.  RE: Building a pause into a movie file

    Posted 07-14-2015 03:21
    I worked on it more, but could not get it working. I would love to see the video tutorial by Brian.

    #XPression


  • 14.  RE: Building a pause into a movie file

    Posted 07-14-2015 16:07
    Try this video guys; I hope this helps; if not let me know where you think you need more info..

    https://ross.brickftp.com/f/de8e8df67

    Here is the exact script I copy/pasted in the video:

    `dim ch as xpOutputFramebuffer

    dim scene as xpScene

    dim obj as xpBaseObject

    dim mat as xpMaterial

    Engine.GetOutputFramebuffer (0, ch)

    ch.GetSceneOnLayer(0, scene)

    scene.getObjectByName("Quad1", obj)

    obj.GetMaterial(0, mat)

    mat.play

    `

    #XPression


  • 15.  RE: Building a pause into a movie file

    Posted 07-15-2015 03:46
    Brian, thank you for taking the time to make that video. I copied your video exactly and copied the script from your previous post and it's still not working for me. Not sure what I did wrong. Could this be a version issue (I'm running 5.9)? I noticed that you were on 5.7. I am using my laptop and a virtual output, not sure if that should matter.

    @Mark, Were you able to get this working on your system?

    #XPression


  • 16.  RE: Building a pause into a movie file

    Posted 07-15-2015 14:23
    @Steve, I would start adding debug to the script to find where it's failing.. Either it's not getting the scene from the out framebuffer or it's not finding the quad or the material..or the keyboard shortcut isnt even triggering the script. Make sure you enable the preference for debug scripting (need to restart after turning it on), then modify the script to be a bit more error safe like this:

    `dim ch as xpOutputFramebuffer

    dim scene as xpScene

    dim obj as xpBaseObject

    dim mat as xpMaterial

    engine.DebugMessage("Playing Script!", 0)

    if Engine.GetOutputFramebuffer (0, ch) then

    if ch.GetSceneOnLayer(0, scene) then

    if scene.getObjectByName("Quad1", obj) then

    obj.GetMaterial(0, mat)

    mat.play

    else

    engine.DebugMessage("Could not find quad1 in scene", 2)

    end if

    else

    engine.DebugMessage("Could not find scene on layer 0", 2)

    end if

    else

    engine.DebugMessage("Could not get output framebuffer",2)

    end if

    `

    #XPression


  • 17.  RE: Building a pause into a movie file

    Posted 07-15-2015 20:47
    It is not working for me either. Should this be a separate script, or in the same script as the pause script?

    #XPression


  • 18.  RE: Building a pause into a movie file

    Posted 07-15-2015 21:32
    This is the same script as the pause/play script - with debug messages.

    It would be mat.play to resume the video and mat.pause to pause the video.

    #XPression


  • 19.  RE: Building a pause into a movie file

    Posted 07-16-2015 01:37
    Hi Brian, thanks for that new script. So I did as you instructed. Pasted the new script into Script Action; script still did not work. Remembered that you said to enable Debug Monitor for Scripting in the Preferences menu; then restarted My Xpression Designer software.

    Then tried the debug script again and it worked fine! BUT! I got no error messages, so on a fluke, I pasted your orginal script back into my script actions, and they worked! Not sure why they are working now, the only thing different I did was enable the Debug Monitor and then restart the software.

    Thanks for taking the time to help troubleshoot this.

    #XPression