I am trying to cut scenes from a video using scenedetect library in Python.
The usual technique is done using changes in image compositions, done via ContentDetector() objects. This is the standard way recommended on their GitHub repository. This is the example code they used:
# Standard PySceneDetect imports:
from scenedetect import VideoManager
from scenedetect import SceneManager
# For content-aware scene detection:
from scenedetect.detectors import ContentDetector
def find_scenes(video_path, threshold=30.0):
# Create our video & scene managers, then add the detector.
video_manager = VideoManager([video_path])
scene_manager = SceneManager()
scene_manager.add_detector(
ContentDetector(threshold=threshold))
# Improve processing speed by downscaling before processing.
video_manager.set_downscale_factor()
# Start the video manager and perform the scene detection.
video_manager.start()
scene_manager.detect_scenes(frame_source=video_manager)
# Each returned scene is a tuple of the (start, end) timecode.
return scene_manager.get_scene_list()
However, there is an alternative technique, based on brightness, that can be done via ThresholdDetector() objects. If I try to substitute ThresholdDetector() to ContentDetector(), I don't get a list of scenes anymore... just only one initial frame.
What am I doing wrong?