-
Notifications
You must be signed in to change notification settings - Fork 414
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
detect_scenes seems to fail when used with callback #416
Comments
Thanks for sharing this, there's definitely a bug here. Will look into this as soon as possible. I suspect the fix will be closely tied with resolving #408. |
Sorry this is unrelated to that actually. The issue is that with the new flash filter, ContentDetector isn't reporting the correct event buffer size. Will have this fixed for the next release, sorry for the troubles. In the meantime here's a few workarounds. WorkaroundsUse import scenedetect
import numpy as np
scene_manager = scenedetect.SceneManager()
scene_manager.add_detector(scenedetect.AdaptiveDetector())
def on_new_scene(frame_img: np.ndarray, frame_num: int):
print(frame_num, video.duration.get_frames())
scene_manager.detect_scenes(video, callback=on_new_scene)
scene_manager.get_scene_list() Set flash filter mode to SUPPRESS: import scenedetect
from scenedetect.scene_detector import FlashFilter
import numpy as np
scene_manager = scenedetect.SceneManager()
scene_manager.add_detector(scenedetect.ContentDetector(filter_mode=FlashFilter.Mode.SUPPRESS))
def on_new_scene(frame_img: np.ndarray, frame_num: int):
print(frame_num, video.duration.get_frames())
scene_manager.detect_scenes(video, callback=on_new_scene)
scene_manager.get_scene_list() Root CauseThis new filter was added as part of #35. The underlying issue is because Thanks for the report! |
With the new flash filter, cuts may be placed behind the current frame. This is similar to AdaptiveDetector, but when the new filter was landed, the max look behind property of the detector wasn't updated. Fixes #416.
Description:
After running for about 1/3 of the video, the code throws the following unexpected exception. The same run works fine if the
callback
ondetect_scenes
is removed.Example:
Include code samples that demonstrate the issue:
Environment:
Media/Files:
I cannot share the video file, but it is similar to this one: https://www.youtube.com/watch?app=desktop&v=2JIfwsv28Es
The text was updated successfully, but these errors were encountered: