A while ago, I came across an interesting looking topic on Super User, titled “Detect video chapter breaks from black screen or no sound in video”. At the time, I had just started working with the Python-OpenCV bindings, and thought I could craft up something fairly effective and fast.
Sure enough, I had a working prototype, and thought others might be interested in such a program… So I present to you: PySceneDetect, a threshold-based video scene detector, written in Python using OpenCV 2. I will be releasing the program as I also create a tutorial showing how it is made. You can find Part 1 here, which covers threshold-based scene detection. Parts 2 and 3 are in the works, and should be released soon.
I plan on expanding the program further to allow for better handling of input/output (Part 2), as well as content-adaptive detection algorithms (Part 3). Using Python and OpenCV for this sort of thing seems very useful, since OpenCV uses FFmpeg to decode video (thus supporting a wide variety of formats), and Python makes it easy to realize algorithms with the SciPy/NumPy packages (both of which are used by the OpenCV-Python implementation).