Python and OpenCV-based scene cut/transition detection program & library
PySceneDetect
Video Scene Cut Detection and Analysis Tool.
Quick Install: To install PySceneDetect via pip
with all dependencies:
pip install scenedetect[opencv]
For servers, you can use the headless (non-GUI) version of OpenCV by installing scenedetect[opencv-headless]
. To enable video splitting support, you will also need to have mkvmerge
or ffmpeg
installed – see the documentation on Video Splitting Support for details.
Requires Python modules click
, numpy
, OpenCV cv2
, and (optional) tqdm
for displaying progress. For details, see the dependencies on the downloads page.
Quick Start (Command Line):
Split the input video wherever a new scene is detected:
scenedetect -i video.mp4 detect-content split-video
Skip the first 10 seconds of the input video, and output a list of scenes to the terminal:
scenedetect -i video.mp4 time -s 10s