diff --git a/scenedetect/output/video.py b/scenedetect/output/video.py index c3a0b4cf..c375aeea 100644 --- a/scenedetect/output/video.py +++ b/scenedetect/output/video.py @@ -305,7 +305,7 @@ def split_video_ffmpeg( logger.info("Splitting video with ffmpeg, output path template:\n %s", output_file_template) if output_dir: - logger.info("Output folder:\n %s", output_file_template) + logger.info("Output folder:\n %s", output_dir) if video_name is None: video_name = Path(input_video_path).stem diff --git a/tests/test_output.py b/tests/test_output.py index 78b957a7..d3769eb4 100644 --- a/tests/test_output.py +++ b/tests/test_output.py @@ -12,6 +12,7 @@ """Tests for scenedetect.output module.""" import json +import logging import os import typing as ty from fractions import Fraction @@ -49,7 +50,8 @@ @pytest.mark.skipif(condition=not is_ffmpeg_available(), reason="ffmpeg is not available") -def test_split_video_ffmpeg_default(tmp_path, test_movie_clip): +def test_split_video_ffmpeg_default(tmp_path, test_movie_clip, caplog): + caplog.set_level(logging.INFO, logger="pyscenedetect") video = open_video(test_movie_clip) # Extract three hard-coded scenes for testing, each 30 frames. scenes = [ @@ -65,6 +67,8 @@ def test_split_video_ffmpeg_default(tmp_path, test_movie_clip): video_name = Path(test_movie_clip).stem entries = sorted(tmp_path.glob(f"{video_name}-Scene-*")) assert len(entries) == len(scenes) + # The log should show the output folder, not the filename template. + assert f"Output folder:\n {tmp_path}" in caplog.text @pytest.mark.skipif(condition=not is_ffmpeg_available(), reason="ffmpeg is not available") diff --git a/website/pages/changelog.md b/website/pages/changelog.md index ec012f9e..2eb94165 100644 --- a/website/pages/changelog.md +++ b/website/pages/changelog.md @@ -823,4 +823,5 @@ Development - [bugfix] The OpenCV backend keeps `position` on the last frame after reaching the end of a VFR video, so the last scene no longer ends early (or before it starts) [#561](https://github.com/Breakthrough/PySceneDetect/issues/561) - [bugfix] `save-html --no-images` now writes to the global `-o`/`--output` directory instead of the working directory [#583](https://github.com/Breakthrough/PySceneDetect/pull/583) - [feature] `VideoStream` has a new `close()` method to release the file handles and decoders a video holds, and can be used as a context manager (`with open_video(path) as video:`) to close it automatically. Calling `close()` more than once has no effect. Once an OpenCV, PyAV, MoviePy or concatenated stream is closed, `read()`, `seek()` and `reset()` raise `ValueError`, while properties describing the video (`path`, `name`, `frame_rate`, `duration`, `frame_size`, `aspect_ratio`) remain available. The default implementation does nothing, so existing `VideoStream` subclasses are unaffected, and `VideoCaptureAdapter` leaves the caller's `VideoCapture` open [#568](https://github.com/Breakthrough/PySceneDetect/issues/568) - - [bugfix] `VideoStreamConcat` no longer keeps its input videos open when they can't be concatenated (e.g. mismatched resolutions), and now closes each input explicitly once it is no longer needed instead of relying on garbage collection [#568](https://github.com/Breakthrough/PySceneDetect/issues/568) \ No newline at end of file + - [bugfix] `VideoStreamConcat` no longer keeps its input videos open when they can't be concatenated (e.g. mismatched resolutions), and now closes each input explicitly once it is no longer needed instead of relying on garbage collection [#568](https://github.com/Breakthrough/PySceneDetect/issues/568) + - [bugfix] `split-video` with `-o` now logs the output folder instead of repeating the filename template [#595](https://github.com/Breakthrough/PySceneDetect/pull/595) \ No newline at end of file