PySceneDetect is a Python library and command-line tool for detecting scene cuts and transitions in video files using OpenCV.
The tool addresses the problem of automatically identifying where scenes change in video content, which is useful for video editing, analysis, and splitting workflows. It provides multiple detection algorithms: a content-aware detector that identifies abrupt changes in frame content, an adaptive two-pass detector designed to handle fast camera movement more robustly, and a threshold detector for fade transitions. Users can apply these detectors through either a command-line interface or a Python API, with results returned as lists of scene boundaries with precise timestamps.
Developers should choose this tool if they need to programmatically split videos by scene or extract keyframes at transition points. It suits projects ranging from automated video processing pipelines to interactive editing applications. The tool integrates with ffmpeg and mkvmerge for actual video splitting, and offers a Docker image with all dependencies pre-installed for environments where local setup is impractical. The project includes benchmark data comparing detector accuracy and processing speed across different algorithms, allowing users to select the approach that best fits their content characteristics.
The project maintains active engagement through a Discord community channel. Development includes regular updates to the codebase with improvements to detection algorithms and API refinements. The tool is distributed through multiple channels including pip, native Windows installers, and containerized images, indicating attention to accessibility across different user environments and deployment scenarios.