For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
plan_frame_indices
plan_frame_indices()
max.pipelines.context.plan_frame_indices(total_frames, fps, *, num_frames=None, target_fps=None, sampling='uniform', start_frame=None, end_frame=None, min_frames=1, max_frames=None, rounding='round')
Predicts which frames decode_video_frames() would keep.
Same policy arguments, no decoding, so a caller can size the result before committing to it – for instance to reject a request from the container header alone rather than after paying for the decode. The decoded-byte budget is not applied here, so this is an upper bound on the sample.
-
Parameters:
-
- total_frames (int) – Number of frames in the source.
- fps (float) – The source frame rate.
- num_frames (int | None) – See
decode_video_frames(). - target_fps (float | None) – See
decode_video_frames(). - sampling (Literal['uniform', 'walk']) – See
decode_video_frames(). - start_frame (int | None) – See
decode_video_frames(). - end_frame (int | None) – See
decode_video_frames(). - min_frames (int) – See
decode_video_frames(). - max_frames (int | None) – See
decode_video_frames(). - rounding (Literal['round', 'floor']) – See
decode_video_frames().
-
Returns:
-
The source frame indices that would be sampled.
-
Return type: