Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
--min-scene-len does not respect first scene #105
When specifying the
For instance, if I have a 30m video with a fade to black at 1m, 15m and 29m. I would expect with a threshold of 300,000 (10 minutes), I would only have two 15m slices. Instead, I see the first fade detected, as well as the third, as the scenes in between are of sufficient length.
Expected behavior would be that these are included as part of the adjacent scenes.
I have a code change that I committed to master just now which should address this issue.
Would you be willing to test the fix out to confirm that it has resolved your issue?
You can test the fix out by cloning the repo or downloading it as an archive and extracting the files. Then, place the video in the folder where you cloned/extracted the files, and run the
@pgodwin good catch, thank you. Will work on that next.
To fix the endings, I will need to post-process the last two scenes added to the scene list, merging them if the stuff after it is actually too small.
@charlesvestal unfortunately they are not related in terms of the code changes which caused the bug, but that is one I still do have to get to for sure.
Thank you both!!
Alright, this should be fixed for the beginning of videos for both ThresholdDetector and ContentDetector in master as of 557bbc5. Feel free to checkout and install the latest development version as above until this is released in v0.5.2.
That being said, I'm not sure if it's worth it to apply the same logic to the end of the video - thoughts? Is your expectation that even the last scene complies with the minimum scene length even in the event that can't be met (by merging it with a previous scene)?
If so I can consider adding a command line option for that as an enhancement, but would prefer it's tracked under a different issue if possible (just since this one has been root caused and a solution has been proposed).
The bugfix I applied is only for the first scene, since it's less correct to merge the last scene with it's predecessor simply because there weren't any frames left in the video. I've updated the title of this issue to reflect that.
I personally don't feel that it's correct to apply this logic to the last scene, just because the last scene is generated out of the only remaining frames. If you (or anyone) happen to disagree with that logic, and feel like such an option is useful or adds value/utility to PySceneDetect, feel free to create a new feature/enhancement request. If you can specify what you would call the command-line option to enable/disable the feature as well, that would be appreciated.
Thanks! That sounds like it would work as expected. And I think you're right in the sense of detecting scenes as this tool is intended to be used for. :) My use case was to split files containing multiple episodes of a show for instance, detecting black between episodes but ignoring other fades at the end of episodes. When used in conjunction with analyzed duration that should be a sufficient solve.