CSV timecodes for VFR video should match known ground truth for both backends.
(test_vfr_video: str, backend: str, tmp_path)
| 272 | |
| 273 | @pytest.mark.parametrize("backend", ["pyav", "opencv"]) |
| 274 | def test_vfr_csv_accuracy(test_vfr_video: str, backend: str, tmp_path): |
| 275 | """CSV timecodes for VFR video should match known ground truth for both backends.""" |
| 276 | video = open_video(test_vfr_video, backend=backend) |
| 277 | sm = SceneManager() |
| 278 | sm.add_detector(ContentDetector()) |
| 279 | sm.detect_scenes(video=video, end_time=10.0) |
| 280 | scene_list = sm.get_scene_list() |
| 281 | assert len(scene_list) >= len(EXPECTED_SCENES_VFR) |
| 282 | |
| 283 | csv_path = tmp_path / "scenes.csv" |
| 284 | with open(csv_path, "w", newline="") as f: |
| 285 | write_scene_list(f, scene_list, include_cut_list=False) |
| 286 | |
| 287 | with open(csv_path) as f: |
| 288 | rows = list(csv.DictReader(f)) |
| 289 | |
| 290 | for i, (row, (exp_start, exp_end)) in enumerate(zip(rows, EXPECTED_SCENES_VFR, strict=False)): |
| 291 | assert row["Start Timecode"] == exp_start, ( |
| 292 | f"[{backend}] Scene {i + 1} start: expected {exp_start!r}, got {row['Start Timecode']!r}" |
| 293 | ) |
| 294 | assert row["End Timecode"] == exp_end, ( |
| 295 | f"[{backend}] Scene {i + 1} end: expected {exp_end!r}, got {row['End Timecode']!r}" |
| 296 | ) |
| 297 | |
| 298 | |
| 299 | @pytest.mark.parametrize("backend", ["pyav", "opencv"]) |
nothing calls this directly
no test coverage detected