MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / test_api_scene_manager

Function test_api_scene_manager

tests/test_api.py:44–54  ·  view source on GitHub ↗

Demonstrate how to use a SceneManager to implement a function similar to `detect()`.

(test_video_file: str)

Source from the content-addressed store, hash-verified

42
43
44def test_api_scene_manager(test_video_file: str):
45 """Demonstrate how to use a SceneManager to implement a function similar to `detect()`."""
46 from scenedetect import ContentDetector, SceneManager, open_video
47
48 video = open_video(test_video_file)
49 scene_manager = SceneManager()
50 scene_manager.add_detector(ContentDetector())
51 scene_manager.detect_scenes(video=video)
52 scene_list = scene_manager.get_scene_list()
53 for i, scene in enumerate(scene_list):
54 print(f"Scene {i + 1}: {scene[0].get_timecode()} - {scene[1].get_timecode()}")
55
56
57def test_api_scene_manager_start_end_time(test_video_file: str):

Callers

nothing calls this directly

Calls 7

add_detectorMethod · 0.95
detect_scenesMethod · 0.95
get_scene_listMethod · 0.95
open_videoFunction · 0.90
SceneManagerClass · 0.90
ContentDetectorClass · 0.90
get_timecodeMethod · 0.80

Tested by

no test coverage detected