-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to detect-threshold
to ignore shorter scene boundaries
#278
Comments
Thanks for the detailed description. For some background, by far, the biggest issues with the existing In the meantime, your solution seems like a very reasonable approach to get around this issue. I would suggest a different name for the argument though, e.g. Edit: I don't have a specific timeline for adding this, but happy to accept any PRs to the upcoming version (v0.6.1) if someone wants to add this in early. Otherwise will schedule this in for one of the following releases. |
Glad you like the suggestion. I wasn't totally happy with the option name either. As you can see, I got pretty close to taking a stab at it. I'll give it a shot if I can find the time. |
Description of Problem & Solution
Sometimes there are shorter fades-through-black in the middle of a scene and you don't want to introduce cut points at them. Currently the
process_frame
method ofThresholdDetector
will introduce a scene cut any time the frame average dips below the threshold.Proposed Implementation:
Add an optional argument
--min-cut-len=[time]
todetect-threshold
that will skip (that is, not cut at) fades-through-black that are shorter than time. If time is an integer, interpret it as a number of frames; if time is a floating-point number withs
appended, interpret it as a number of seconds; if time is a time code, interpret it as a hour:minute:second duration.I think all that would have to be done is to set a property
min_cut_len
and change line line 149 ofscenedetect.detectors.threshold_detector
fromto something along the lines of
Alternative Solutions:
Setting the minimum scene length with
--min-scene-len
or-m
will sometimes have the desired effect, but only coincidentally. If a 20-minute scene has a half-second fade five minutes from the beginning, setting-m=360s
will not cut at that point. But setting this minimum scene length too high may miss the longer fades and effectively clump different parts of different scenes together.The text was updated successfully, but these errors were encountered: