MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / test_vfr_csv_output

Function test_vfr_csv_output

tests/test_vfr.py:147–166  ·  view source on GitHub ↗

CSV export should work correctly with VFR video.

(test_vfr_video: str, tmp_path)

Source from the content-addressed store, hash-verified

145
146
147def test_vfr_csv_output(test_vfr_video: str, tmp_path):
148 """CSV export should work correctly with VFR video."""
149 from scenedetect.output import write_scene_list
150
151 video = open_video(test_vfr_video, backend="pyav")
152 sm = SceneManager()
153 sm.add_detector(ContentDetector())
154 sm.detect_scenes(video=video)
155 scene_list = sm.get_scene_list()
156 assert len(scene_list) > 0
157
158 csv_path = os.path.join(str(tmp_path), "scenes.csv")
159 with open(csv_path, "w", newline="") as f:
160 write_scene_list(f, scene_list)
161
162 # Verify CSV contains valid data.
163 with open(csv_path) as f:
164 reader = csv.reader(f)
165 rows = list(reader)
166 assert len(rows) >= 3 # 2 header rows + data
167
168
169@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
write_scene_listFunction · 0.90

Tested by

no test coverage detected