Repository navigation
ContentDetector merge filter: one short scene early on changes where (or whether) a much later cut is reported #585
Unanswered
sungbin1015
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm using ContentDetector with threshold=15 and min_scene_len of about 1s (default filter_mode) to split long sports broadcasts into shots. While testing on synthetic clips I noticed that a single short scene early in the video changes how a cut hundreds of frames later gets reported.
On 0.7.2 (same on 0.6.7 and 0.7.0, OpenCV 5.0.0):
The 2nd and 4th clips only add a cut at frame 110, which is 290 / 470 frames before the cut I care about. With it, the 400/415 pair comes out at 415 instead of 400, and the cut at 580 (20 frames before the end) is gone entirely. With
filter_mode=FlashFilter.Mode.SUPPRESSall four give 400 / 580 as I'd expect.From reading
_filter_merge, the 100→110 short scene sets_merge_triggered, and that only clears once_last_above - _merge_start >= min_scene_len, which a lone short scene never satisfies. So the filter stays armed through the quiet stretch, then holds the next real cut until another min_scene_len of quiet frames, and loses it if the video ends first. Your comment in #35 describes cuts being suppressed "until min-scene-len frames pass without a cut", so I expected it to reset somewhere in those 290 frames. #469 looks related, but there the difference came from changing min_scene_len, not from an earlier short scene with the same settings.Is this the intended merge behaviour, or should the merge state clear after min_scene_len frames without a cut?
All reactions