Directly delete short scenes by Python API #422
yumianhuli1
started this conversation in
General
Replies: 1 comment 1 reply
-
You can filter them out pretty easily with import scenedetect
detector = scenedetect.ContentDetector(min_scene_len=0))
scenes = scenedetect.detect("tests/resources/goldeneye.mp4", detector=detector)
# drop scenes shorter than 0.5 seconds, s[0] is start timecode, s[1] is end timecode
scenes = [s for s in scenes if (s[1] - s[0]) >= 0.5] |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
The min_scene_len parameter specified in scene_manager.add_detector(ContentDetector(threshold=27.0, min_scene_len=15)) will only merge short scenes into large scenes. However, my requirement is to directly delete scenes with fragments less than 0.5 seconds without appearing in the scene list. Do you have this api function and parameter? Or Just use min_scene_len=0 and then use ffmpeg?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions