Breakthrough/PySceneDetect

:movie_camera: Python and OpenCV-based scene cut/transition detection program & library.

What it solves

PySceneDetect automates the process of finding cuts and scene changes in video files. Instead of manually scrubbing through footage to find where one shot ends and another begins, this tool identifies these transitions and can automatically split the video into individual scenes or save representative frames from each cut.

How it works

The tool analyzes video content using different detection algorithms to identify scene boundaries. It offers three primary detectors:

  • ContentDetector: Performs content-aware detection to find fast cuts.
  • AdaptiveDetector: A two-pass version designed to better handle fast camera movement.
  • ThresholdDetector: Specifically designed to handle fade-in and fade-out events.

Users can interact with the tool via a command-line interface (CLI), a Python API for integration into larger pipelines, or a Docker image. It leverages ffmpeg or mkvmerge to perform the actual video splitting.

Who it’s for

It is designed for video editors, data scientists working with video datasets, and developers building automated video processing pipelines who need to programmatically segment videos into scenes.

Highlights

  • Multiple Detection Modes: Supports content-aware, adaptive, and threshold-based detection.
  • Automated Splitting: Integrates with ffmpeg and mkvmerge to automatically cut videos into separate files based on detected scenes.
  • Flexible Interface: Available as a standalone CLI tool, a Python library, and a Docker container.
  • Frame Extraction: Ability to save images from each detected cut for quick review.

Related

  • Project
  • Project
  • Project
  • Project
  • Project