Scroll frame by frame through video?

176 views
Skip to first unread message

David Fernandez

unread,
Jan 31, 2023, 5:04:44 AM1/31/23
to QLab
Hola!
I would like to map one key and go frame by frame through a video or png sequence. I tryed to drop directly the png sequence on Qlab, but I have many, and it's more than 4.000 cues ... not very practical.

Is there a way to manually scroll a video frame by frame??

Thank you a lot!

micpool

unread,
Jan 31, 2023, 7:23:38 AM1/31/23
to QLab
Yes but it's a bit fiddly. Basically you have to get your video in a paused state at time 0


You then advance the load time of a load cue by .04 seconds (for 25fps video) and start the load cue

The script to do this is 

tell application id "com.figure53.QLab.5" to tell front workspace
    set the load time of cue "LOAD" to (load time of cue "LOAD") + 0.04
    start cue "LOAD"
end tell

Screenshot 2023-01-31 at 12.23.08.png

Advance 1 frame-HD 1080p.mov

David Fernandez

unread,
Jan 31, 2023, 8:27:35 AM1/31/23
to QLab
Thank you! I don't know where my reply went ... I explained better there ..

micpool

unread,
Feb 6, 2023, 8:54:07 AM2/6/23
to QLab
On Tuesday, January 31, 2023 at 1:27:35 PM UTC David Fernandez wrote:
Thank you! I don't know where my reply went ... I explained better there ..


Hi David

Your reply didn't go to the group because you replied just to me, instead of the group

Although the solution is somewhat complicated (actually a lot more complicated than it at first appears, mainly because calculated times don't always exactly coincide with frame boundaries, and it's possible to load cues to  action elapsed times beyond their duration).  I have persisted in getting this  to work  as it is  is potentially very useful for cueing up normal videos visually, as well as your usage to step through frames of a video as stills.

I have found the best way of avoiding problems is loading to  the action elapsed times calculated to be in the middle of frame boundaries  and making sure the action elapsed never exceeds the  duration.

I have boiled the whole thing down to a universal script, that is easily modified by setting a few variables at the top to change fps,  direction and step size. You only need 1 script set for the whole workspace, as the script selects the last active video which is paused and steps through that. I have used 2 hotkeys for forwards and back, shifted for 10X.

Screenshot 2023-02-06 at 13.45.39.png

Here's the script:

--step through a paused video frame by frame
-- Do not run as separate process (uncheck box) this allows keystrokes to be queued
set theFrameRate to 30 --fps of your video file
set theDirection to 1 --     1 for forwards.    -1 for Back
set theStep to 1 --number of frames to move
tell front workspace
    set theInterval to 1 / theFrameRate
    set theMargin to theInterval / 2
    try
        set theTarget to last item of (cues whose paused is true and q type is "video")
        set theCurrentTime to the ((((action elapsed of theTarget) / theInterval) div 1) * theInterval) + theMargin + (theInterval * theStep * theDirection)
        set theDuration to duration of theTarget
        delay 0.1
        if theCurrentTime is not less than theDuration then set theCurrentTime to theDuration - 1.0E-3
        load theTarget time theCurrentTime
    end try
end tell  


Demo Screen recording attached. 


Mic

 
micpool schrieb am Dienstag, 31. Januar 2023 um 13:23:38 UTC+1:
Yes but it's a bit fiddly. Basically you have to get your video in a paused state at time 0


You then advance the load time of a load cue by .04 seconds (for 25fps video) and start the load cue




Screen Recording 2023-02-06 at 13.41.49.mov

micpool

unread,
Feb 6, 2023, 8:56:24 AM2/6/23
to QLab
And here's a QLab 4 Workspace


Mic

On Monday, February 6, 2023 at 1:54:07 PM UTC micpool wrote:

Although the solution is somewhat complicated (actually a lot more complicated than it at first appears, mainly because calculated times don't always exactly coincide with frame boundaries, and it's possible to load cues to  action elapsed times beyond their duration).  I have persisted in getting this  to work  as it is  is potentially very useful for cueing up normal videos visually, as well as your usage to step through frames of a video as stills.

I have found the best way of avoiding problems is loading to  the action elapsed times calculated to be in the middle of frame boundaries  and making sure the action elapsed never exceeds the  duration.

I have boiled the whole thing down to a universal script, that is easily modified by setting a few variables at the top to change fps,  direction and step size. You only need 1 script set for the whole workspace, as the script selects the last active video which is paused and steps through that. I have used 2 hotkeys for forwards and back, shifted for 10X.



Step through Video by frames.zip

micpool

unread,
Feb 6, 2023, 9:01:56 AM2/6/23
to QLab
On Monday, February 6, 2023 at 1:56:24 PM UTC micpool wrote:
And here's a QLab 4 Workspace

This won't currently work in QLab 5

Mic 

micpool

unread,
Feb 27, 2023, 12:18:46 PM2/27/23
to QLab
This now works fine in QLab 5.1

Mic

Reply all
Reply to author
Forward
0 new messages