AutoMovie API
    Preparing search index...

    Function planAutoMovieCaptureFrames

    • Plan the instants a capture draws, for a drawn scene and for a video file alike: an even sampling or explicit seconds, merged with every frame within window frames of each event and each cut.

      The subject's frames are the indices 0 to N - 1 with N = ceil(durationSeconds × fps), frame i showing second i / fps. An even sample is moved to the nearest frame, so every still is a frame the subject encodes, and stops before to. An explicit second is kept as written. The frame nearest an event or a cut is round(seconds × fps), and its window runs window frames to each side at the frame rate, cut at the first and last frame. The result is in time order with every frame once, and each window is listed with whether the bounds cut it.

      It throws for a frame rate or duration that is not positive, a sampling that starts at or after the subject's end or ends past it, an explicit second, event or cut outside [0, durationSeconds], and a window that is not a whole number of frames.

      planAutoMovieCaptureFrames({ durationSeconds: 4, fps: 30, sampling: { kind: "even", from: 0, to: null, rate: 5 }, events: [2], cuts: [], window: 3 });
      // frames 0, 6, 12, ... with 57 to 63 around the event

      Returns IAutoMovieCaptureFramePlan