Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scenedetect/detectors/content_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,7 @@ def _detect_edges(self, lum: numpy.ndarray) -> numpy.ndarray:
# camera movement. Note that very large kernel sizes can negatively affect accuracy.
edges = cv2.Canny(lum, low, high)
return cv2.dilate(edges, self._kernel)

@property
def event_buffer_length(self) -> int:
return self._flash_filter.max_behind
7 changes: 6 additions & 1 deletion scenedetect/scene_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,12 @@ def __init__(self, mode: Mode, length: int):
self._last_above = None # Last frame above threshold.
self._merge_enabled = False # Used to disable merging until at least one cut was found.
self._merge_triggered = False # True when the merge filter is active.
self._merge_start = None # Frame number where we started the merge filte.
self._merge_start = None # Frame number where we started the merge filter.

@property
def max_behind(self) -> int:
"""Maximum number of frames a filtered cut can be behind the current frame."""
return 0 if self._mode == FlashFilter.Mode.SUPPRESS else self._filter_length

def filter(self, frame_num: int, above_threshold: bool) -> ty.List[int]:
if not self._filter_length > 0:
Expand Down
3 changes: 2 additions & 1 deletion website/pages/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,4 +589,5 @@ Development
## PySceneDetect 0.6.5 (TBD)

- [bugfix] Fix new detectors not working with `default-detector` config option
- [bugfix] Fix SyntaxWarning due to incorrect escaping [#400](https://github.com/Breakthrough/PySceneDetect/issues/400)
- [bugfix] Fix `SyntaxWarning` due to incorrect escaping [#400](https://github.com/Breakthrough/PySceneDetect/issues/400)
- [bugfix] Fix `ContentDetector` crash when using callbacks [#416](https://github.com/Breakthrough/PySceneDetect/issues/416)