2026-05-18-20-35-32 修复结果视频关键帧空白

This commit is contained in:
2026-05-18 20:39:52 +08:00
parent 5264c5c7fc
commit 69444ced72
6 changed files with 93 additions and 1 deletions

View File

@@ -78,9 +78,18 @@ def test_segment_video_and_compare_frame(tmp_path: Path):
assert result_capture.isOpened()
result_frames = int(result_capture.get(cv2.CAP_PROP_FRAME_COUNT) or 0)
result_fps = float(result_capture.get(cv2.CAP_PROP_FPS) or 0)
result_capture.set(cv2.CAP_PROP_POS_FRAMES, 1)
ok, carried_overlay = result_capture.read()
result_capture.release()
assert result_frames == 18
assert abs((result_frames / result_fps) - payload["duration"]) < 0.25
assert ok
yellow_pixels = (
(carried_overlay[:, :, 1] > 140)
& (carried_overlay[:, :, 2] > 140)
& (carried_overlay[:, :, 0] < 150)
).sum()
assert yellow_pixels > 0
with video_path.open("rb") as handle:
compare = client.post(