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

Function test_capture_adapter

tests/test_backend_opencv.py:41–53  ·  view source on GitHub ↗

Test that the VideoCaptureAdapter works with SceneManager.

(test_movie_clip: str)

Source from the content-addressed store, hash-verified

39
40
41def test_capture_adapter(test_movie_clip: str):
42 """Test that the VideoCaptureAdapter works with SceneManager."""
43 cap = cv2.VideoCapture(test_movie_clip)
44 assert cap.isOpened()
45 adapter = VideoCaptureAdapter(cap)
46 assert adapter.read() is not False
47
48 scene_manager = SceneManager()
49 scene_manager.add_detector(ContentDetector())
50 assert scene_manager.detect_scenes(video=adapter, duration=adapter.base_timecode + 10.0)
51 scenes = scene_manager.get_scene_list()
52 assert len(scenes) == len(GROUND_TRUTH_CAPTURE_ADAPTER_TEST)
53 assert [start.frame_num for (start, _) in scenes] == GROUND_TRUTH_CAPTURE_ADAPTER_TEST

Callers

nothing calls this directly

Calls 7

readMethod · 0.95
add_detectorMethod · 0.95
detect_scenesMethod · 0.95
get_scene_listMethod · 0.95
VideoCaptureAdapterClass · 0.90
SceneManagerClass · 0.90
ContentDetectorClass · 0.90

Tested by

no test coverage detected