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)
| 168 | |
| 169 | @pytest.mark.parametrize("backend", ["pyav", "opencv"]) |
| 170 | def 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"]) |
nothing calls this directly
no test coverage detected