PySceneDetect is a Python- and OpenCV-based video scene change and transition detection program and library, mainly used to automatically identify shot change points in videos and to split and analyze videos.
Purpose PySceneDetect is aimed at scenarios that require processing video editing, shot segmentation, and scene analysis. It can detect fast cuts in videos as well as transition events such as fade-out/fade-in, and output the start and end times of each scene, facilitating subsequent editing, indexing, or batch processing.
Main capabilities
- Content-aware scene detection: high-level functions can be used to perform scene detection on a video, returning a list containing the start and end times of all scenes.
- Multiple detection algorithms: provides detectors such as AdaptiveDetector (two-pass processing, with better adaptability to fast camera movement) and ThresholdDetector (used to handle fade-out/fade-in events).
- Video splitting: when ffmpeg or mkvmerge is installed, the input video can be split by each scene.
- Frame saving: supports saving partial frames from each cut point.
- Time skipping: supports skipping the first several seconds of the input video.
- Performance evaluation: the project has benchmarked the accuracy and processing speed of different detectors, and the results can be viewed on the official website benchmarks page.
Usage
- Command line: after installation, the command-line tool can be used directly. For example, operations such as splitting a video by fast cuts, saving frames at each cut point, and skipping the first 10 seconds all have corresponding commands; more examples can be found in the official documentation.
- Docker: the official Docker image ghcr.io/breakthrough/pyscenedetect includes all dependencies (including ffmpeg/mkvmerge), so the same commands can be run without local installation; simply mount the folder containing the video as the input/output path.
- Python API: the library provides high-level functions to perform content-aware scene detection and return scene_list; the lower-level scenedetect API can also be used to implement custom workflows, including using different detection algorithms and splitting videos. The API is highly configurable and easy to integrate into any pipeline.
Installation and dependencies
- Quick installation: Windows provides an MSI installer and a portable ZIP, available on the download page; the Docker image includes all dependencies.
- Video splitting support requires ffmpeg or mkvmerge.
Applicable scenarios
- Shot segmentation and material organization before video editing.
- Batch video scene analysis and indexing.
- Development scenarios that require integrating scene detection into automated pipelines.
Limitations and notes
- The video splitting feature depends on ffmpeg or mkvmerge, which must be installed separately or used via a Docker image that includes the dependencies.
- Different detection algorithms differ in accuracy and processing speed; specific benchmark results should be referenced on the official benchmarks page.
- The project uses the BSD 3-Clause license, and submitted code must comply with that license.
- The latest version is v0.7.2 (October 11, 2026).
Help and contributions Questions or feature requests can be submitted to the Issue Tracker; before submitting, it is recommended to search existing issues first to avoid duplicates; Pull Requests are welcome. You can also join the official Discord server for help.