Repository navigation
[bugfix] Divide detect-threshold fade-bias by 100 (#625) - #626
Merged
Breakthrough merged 3 commits intoNov 28, 2026
Merged
Conversation
Breakthrough
requested changes
Nov 28, 2026
Breakthrough
left a comment
Owner
There was a problem hiding this comment.
Need to address failing static checks.
Contributor
Author
|
Thanks. Fixed in b6fb6b4. Pyright flagged |
Breakthrough
approved these changes
Nov 28, 2026
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.
Fixes #625.
--fade-biasand thefade-biasconfig value are a percent from -100 to 100 (see the option help anddocs/cli.rst), butThresholdDetectortakes -1.0 to 1.0. Before 9f1525e the CLI converted withfade_bias /= 100.0. That step was lost, so a negative bias raisedValueError: Timecode frame number must be positive and greater than zero.and a positive bias put the cut far past the end of the video (-f 50gave frame 576 in a 100 frame video).The change divides the resolved value by 100.0 in
CliContext.get_detect_threshold_params, which covers the option and the config file. The default of 0 stays 0.0.Behavior change:
--fade-bias/config values other than 0 now mean what the docs say. Nobody could get a sensible result from non-zero values before, since negative ones crashed.Tests:
test_cli_detect_threshold_fade_bias_is_a_percent(5 values, builds a small fade video). It fails on main for -100, -50, 50 and 100 and passes with the fix.pytest tests/test_cli.py tests/test_threshold_detector.py tests/test_detectors.py: 254 passed, 1 skipped. A second Windows run without PyAV and moviepy gave 233 passed, 4 skipped and 18 failed, the same 18 tests that fail on main there (PyAV, moviepy and stdin tests).pytest testson main before the change: 743 passed, 1 failed, 2 skipped. The failure istest_write_scene_list_ffmetadata_ffmpeg_roundtrip, which needs ffmpeg on PATH.ruff checkandruff format --checkclean on both files.Validated with Claude Opus 5.5.