Backends¶

PySceneDetect supports multiple backends for video input. Some can be configured by using a config file. Installed backends can be verified by running scenedetect version --all.

OpenCV¶

[Default] The OpenCV backend (usually opencv-python) uses OpenCV’s VideoCapture for video input. Can be used by specifying -b opencv via command line, or setting backend = opencv under the [global] section of your config file.

It is mostly reliable and fast, although can occasionally run into issues processing videos with multiple audio tracks or small amounts of frame corruption. You can use a custom version of the cv2 package, or install either the opencv-python or opencv-python-headless packages from pip.

The OpenCV backend also supports image sequences as inputs (e.g. frame%02d.jpg if you want to load frame001.jpg, frame002.jpg, frame003.jpg…). Make sure to specify the framerate manually (-f/--framerate) to ensure accurate timing calculations.

PyAV¶

The PyAV backend (av package) is a more robust backend that handles multiple audio tracks and frame decode errors gracefully.

This backend can be used by specifying -b pyav via command line, or setting backend = pyav under the [global] section of your config file.