PySceneDetect

Intelligent scene cut detection and video splitting tool.

  Latest Release: v0.5 (August 31, 2018)

  Download        Changelog        Installation        Getting Started

  The PySceneDetect command-line interface and Python API has changed.

This documentation refers to PySceneDetect v0.5, which has a new-and-improved command line interface (CLI) and an improved/refactored Python API. A new manual for PySceneDetect has also been published, which will serve as a reference guide/documentation for both the CLI and API moving forwards:
http://man.scenedetect.com/
Users still using the latest stable release (v0.4) can find the existing documentation for v0.4 here.

PySceneDetect is a command-line application and a Python library for detecting scene changes in videos, and automatically splitting the video into separate clips. Not only is it free and open-source software (FOSS), but there are several detection methods available (see Features), from simple threshold-based fade in/out detection, to advanced content aware fast-cut detection of each shot.

PySceneDetect can be used on its own as a stand-alone executable, with other applications as part of a video processing pipeline, or integrated directly into other programs/scripts via the Python API. PySceneDetect is written in Python, and requires the OpenCV and Numpy software libraries.

Examples and Use Cases

Here are some of the things people are using PySceneDetect for:

  • splitting home videos or other source footage into individual scenes
  • automated detection and removal of commercials from PVR-saved video sources
  • processing and splitting surveillance camera footage
  • statistical analysis of videos to find suitable "loops" for looping GIFs/cinemagraphs
  • academic analysis of film and video (e.g. finding mean shot length)

Of course, this is just a small slice of what you can do with PySceneDetect, so why not try it out for yourself! The timecode format used by default (HH:MM:SS.nnnn) is compatible with most popular video tools, so in most cases the output scene list from PySceneDetect can be directly copied and pasted into another tool of your choice (e.g. ffmpeg, avconv or the mkvtoolnix suite).