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

Function test_cli_save_images_rotation

tests/test_cli.py:641–657  ·  view source on GitHub ↗

Test that `save-images` command rotates images correctly with the default backend.

(rotated_video_file, tmp_path: Path)

Source from the content-addressed store, hash-verified

639# TODO(https://scenedetect.com/issues/134): This works fine with OpenCV currently, but needs to be
640# supported for PyAV and MoviePy.
641def test_cli_save_images_rotation(rotated_video_file, tmp_path: Path):
642 """Test that `save-images` command rotates images correctly with the default backend."""
643 assert (
644 invoke_scenedetect(
645 "-i {VIDEO} {DETECTOR} time {TIME} save-images",
646 VIDEO=rotated_video_file,
647 output_dir=tmp_path,
648 )
649 == 0
650 )
651 images = [image for image in tmp_path.glob("*.jpg")]
652 # Should detect two scenes and generate 3 images per scene with above params.
653 assert len(images) == 6
654 image = cv2.imread(str(images[0]))
655 assert image is not None
656 # Note same resolution as in test_cli_save_images but rotated 90 degrees.
657 assert image.shape == (1280, 544, 3)
658
659
660def test_cli_save_html(tmp_path: Path):

Callers

nothing calls this directly

Calls 1

invoke_scenedetectFunction · 0.85

Tested by

no test coverage detected