Closed adbmdp closed 2 months ago
Get it to work like this:
import scenedetect
from scenedetect import open_video
from scenedetect import SceneManager, save_images
from scenedetect.detectors import ContentDetector
def detect_scenes(video_path, threshold=27.0):
# Open the video
video = open_video(video_path)
# Create the scene manager
scene_manager = SceneManager()
# Add the content detector
scene_manager.add_detector(ContentDetector(threshold=threshold))
# Detect the scenes
scene_manager.detect_scenes(video)
scene_list = scene_manager.get_scene_list()
scenedetect.scene_manager.save_images(scene_list, video, num_images=3, output_dir='images')
# Get the list of detected scenes
return scene_list
# Example usage
video_path = "https://www.mysite.com/video.mp4"
scene_list = detect_scenes(video_path)
for i, (start, end) in enumerate(scene_list):
print(f"Scene {i+1}: {start.get_timecode()} - {end.get_timecode()}")
Description:
I can't get save_images to work.
Example:
Environment:
Media/Files:
Error :
AttributeError: 'SceneManager' object has no attribute 'save_images'
Any help appreciated