(test_video_file, tmp_path)
| 148 | |
| 149 | @pytest.mark.release |
| 150 | def 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 |
nothing calls this directly
no test coverage detected