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

Function test_vfr_drop3_scene_detection

tests/test_vfr.py:170–190  ·  view source on GitHub ↗

Synthetic VFR video (drop every 3rd frame, alternating 1x/2x durations) should produce timecodes matching known ground truth with both backends.

(test_vfr_drop3_video: str, backend: str)

Source from the content-addressed store, hash-verified

168
169@pytest.mark.parametrize("backend", ["pyav", "opencv"])
170def test_vfr_drop3_scene_detection(test_vfr_drop3_video: str, backend: str):
171 """Synthetic VFR video (drop every 3rd frame, alternating 1x/2x durations) should produce
172 timecodes matching known ground truth with both backends."""
173 video = open_video(test_vfr_drop3_video, backend=backend)
174 sm = SceneManager()
175 sm.add_detector(ContentDetector())
176 sm.detect_scenes(video=video, show_progress=False)
177 scene_list = sm.get_scene_list()
178
179 assert len(scene_list) >= len(EXPECTED_SCENES_VFR_DROP3), (
180 f"[{backend}] Expected at least {len(EXPECTED_SCENES_VFR_DROP3)} scenes, got {len(scene_list)}"
181 )
182 for i, ((start, end), (exp_start_tc, exp_end_tc)) in enumerate(
183 zip(scene_list, EXPECTED_SCENES_VFR_DROP3, strict=False)
184 ):
185 assert start.get_timecode() == exp_start_tc, (
186 f"[{backend}] Scene {i + 1} start: expected {exp_start_tc!r}, got {start.get_timecode()!r}"
187 )
188 assert end.get_timecode() == exp_end_tc, (
189 f"[{backend}] Scene {i + 1} end: expected {exp_end_tc!r}, got {end.get_timecode()!r}"
190 )
191
192
193@pytest.mark.parametrize("backend", ["pyav", "opencv"])

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