Skip to main content

A cross-platform, OpenCV-based video scene detection program and Python library.

Project description



Github Repo:

PySceneDetect is a command-line tool, written in Python and using OpenCV, which analyzes a video, looking for scene changes or cuts. The output timecodes can then be used with another tool (e.g. mkvmerge, ffmpeg) to split the video into individual clips (or using the split-video command). A frame-by-frame analysis can also be generated for a video, to help with determining optimal threshold values or detecting patterns/other analysis methods for a particular video.

There are two main detection methods PySceneDetect uses: detect-threshold (comparing each frame to a set black level, useful for detecting cuts and fades to/from black), and detect-content (compares each frame sequentially looking for changes in content, useful for detecting fast cuts between video scenes, although slower to process). Each mode has slightly different parameters, and is described in detail in the documentation.

In general, use detect-threshold mode if you want to detect scene boundaries using fades/cuts in/out to black. If the video uses a lot of fast cuts between content, and has no well-defined scene boundaries, you should use the detect-content mode. Once you know what detection mode to use, you can try the parameters recommended below, or generate a statistics file (using the -s / –stats argument) in order to determine the correct paramters - specifically, the proper threshold value.

For help or other issues, feel free to submit any bugs or feature requests to Github:

Licensed under BSD 3-Clause (see the LICENSE file for details).

Copyright (C) 2012-2019 Brandon Castellano. All rights reserved.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for scenedetect, version
Filename, size & hash File type Python version Upload date
scenedetect- (76.0 kB) View hashes Wheel py2
scenedetect- (76.0 kB) View hashes Wheel py3
scenedetect- (60.5 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page