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

Function test_output_split_video

tests/release/test_validation.py:150–178  ·  view source on GitHub ↗
(test_video_file, tmp_path)

Source from the content-addressed store, hash-verified

148
149@pytest.mark.release
150def test_output_split_video(test_video_file, tmp_path):
151 _video, scene_list = _detect(test_video_file)
152 # Split only the first two scenes to bound the runtime.
153 scene_list = scene_list[:2]
154 out_dir = tmp_path / "splits"
155 out_dir.mkdir()
156 output_template = str(out_dir / "scene-$SCENE_NUMBER.mp4")
157 split_video_ffmpeg(test_video_file, scene_list, output_file_template=output_template)
158
159 split_files = sorted(out_dir.glob("*.mp4"))
160 assert len(split_files) == len(scene_list)
161
162 for path in split_files:
163 result = subprocess.run(
164 [
165 "ffprobe",
166 "-v",
167 "error",
168 "-show_entries",
169 "format=duration",
170 "-of",
171 "default=noprint_wrappers=1:nokey=1",
172 str(path),
173 ],
174 capture_output=True,
175 text=True,
176 check=True,
177 )
178 assert float(result.stdout.strip()) > 0

Callers

nothing calls this directly

Calls 3

split_video_ffmpegFunction · 0.90
runMethod · 0.80
_detectFunction · 0.70

Tested by

no test coverage detected