PySceneDetect is completely free software, and can be downloaded from the links below. See the license and copyright information page for details. If you have trouble running PySceneDetect, ensure that you have all the required dependencies listed in the Dependencies section below.
PySceneDetect is compatible with both Python 2 and 3. Note that Python 3 usually provides better performance.
Download and Installation
Install via pip
pip install scenedetect
PySceneDetect is available via
pip as the
Python Installer (All Platforms)
To install from source, download and extract the latest release to a location of your choice, and make sure you have the appropriate system requirements installed before continuing. PySceneDetect can be installed by running the following command in the location of the extracted files (don't forget
sudo if you're installing system-wide):
python setup.py install
After installation, you can call PySceneDetect from any terminal/command prompt by typing
scenedetect (try running
scenedetect version, or
scenedetect --version in v0.4 and prior, to verify that everything was installed correctly).
To get familiar with PySceneDetect, try running
scenedetect help, or continue onwards to the Getting Started: Basic Usage section. If you encounter any runtime errors while running PySceneDetect, ensure that you have all the required dependencies listed in the System Requirements section above (you should be able to
import numpy and
import cv2). If you encounter any issues or want to make a feature request, feel free to report any bugs or share some feature requests/ideas on the issue tracker and help make PySceneDetect even better.
PySceneDetect requires Python 2 or 3 and the following third-party software:
- OpenCV (compatible with 2/3), can install via
pip install opencv
- Numpy, can install via
pip install numpy
- tqdm, optional, can install via
pip install tqdm. Used to show progress bar and estimated time remaining.
Video Splitting Support
For video splitting support, you need to have the following tools available:
- ffmpeg, part of mkvtoolnix, command-line tool, required to split video files in precise/high-quality mode (
- mkvmerge, part of mkvtoolnix, command-line tool, required to split video files in copy mode (
Note that Linux users should use a package manager if possible (e.g.
sudo apt-get install ffmpeg). Windows users may require additional steps in order for PySceneDetect to detect
ffmpeg - see the section Manually Enabling
split-video Support below for details.
Additionally, 64-bit Windows users installing PySceneDetect from source can download ffmpeg.exe and mkvmerge.exe from here. After extracting the files, the executables can be placed same folder as the
scenedetect.exe file created after running
python setup.py install, or somewhere else in your PATH variable. The
scenedetect.exe file is usually installed in the folder
XY is your Python version (e.g. 27, 36).
mkvmerge command must be available system wide (e.g. in a directory in PATH, so it can be used from any terminal/console by typing the command), or alternatively, placed in the same directory where PySceneDetect is installed.
If you have trouble getting PySceneDetect to find
mkvmerge, see the section on Manually Enabling
split-video Support on Getting Started: Video Splitting Support Requirements.
Installing Latest Version of OpenCV (optional)
If you have installed OpenCV using
pip, you will need to uninstall it before continuing on.
You can click here for a quick guide (OpenCV + Numpy on Windows & Linux) on installing the latest versions of OpenCV/Numpy on Windows (using pre-built binaries) and Linux (compiling from source). If the Python module that comes with OpenCV on Windows is incompatible with your system architecture or Python version, see this page to obtain a pre-compiled (unofficial) module.
Note that some Linux package managers still provide older, dated builds of OpenCV (pre-3.0). PySceneDetect is compatible with both versions, but if you want to ensure you have the latest version, it's recommended that you build and install OpenCV from source on Linux.
To ensure you have all the requirements installed, open a
python interpreter, and ensure you can run
import numpy and
import cv2 without any errors.