Skip to main content

detect_scene_changes

Function detect_scene_changes 

Source
pub fn detect_scene_changes<R: Read, T: Pixel>(
    dec: &mut Decoder<R>,
    opts: DetectionOptions,
    frame_limit: Option<usize>,
    progress_callback: Option<&dyn Fn(usize, usize)>,
) -> Result<DetectionResults>
Expand description

Runs through a y4m video clip, detecting where scene changes occur. This is adjustable based on the opts parameters.

This is the preferred, simplified interface for analyzing a whole clip for scene changes.

§Arguments

  • progress_callback: An optional callback that will fire after each frame is analyzed. Arguments passed in will be, in order, the number of frames analyzed, and the number of keyframes detected. This is generally useful for displaying progress, etc.

§Errors

  • If using a Vapoursynth script that contains an unsupported video format.

§Panics

  • If opts.lookahead_distance is 0.