Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Image sequence input (
-i frame%03d.png) was rejected unless-b opencvwas typed, even though OpenCV is the default backend and even when the config file setsbackend = opencv.CliContext._open_video_streamtestedbackend != "opencv"with the raw-bvalue (Nonewhen not given). The configured or default backend was read two lines later, after the check had failed. This moves thatself.config.get_value("global", "backend", backend)line above the check, so the check sees the backend that will really be used.-bstill wins over the config file.Before:
After: the command runs.
-b pyav,-b moviepy, orbackend = pyav/backend = moviepyin the config file with an image sequence still give the same usage error.Behavior changes:
-ipath containing%goes through the same check, so a plain file such as100% done.mp4now opens with the default backend instead of being rejected. With-b pyavor-b moviepyit is still rejected.%path that does not exist now gets the normal "Failed to open input video" error instead of the image sequence error, when the effective backend is opencv.backendvalue in the config file behaves as before.Tests: three new tests in
tests/test_cli.py.test_cli_image_sequence_uses_default_backendandtest_cli_image_sequence_uses_config_backendfail on main and pass with the change.test_cli_image_sequence_rejects_other_backendpasses on both and guards the kept error.tests/test_cli.pywithout the pyav and moviepy backends installed: 148 passed, 18 failed. The 18 failures need those backends and fail on main too.ruff checkandruff format --checkon the changed files are clean, andpyrightonscenedetect/_cli/context.pyreports 0 errors.Note: open PR #591 also edits
_open_video_stream(it adds aframe_numberingparameter), so whichever lands second needs a one-line context rebase. The two changes do not overlap in intent. I checked that this diff applies on top of #591 withgit apply -C1, and the three tests pass there.Fixes #620
Validated with Claude Opus 5.5.