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.
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