Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow selection of which scenes images and video clips are made with save-images and spit-video #123
Comments
|
I still think there's value in saying "give me the first X scenes" or "give me the last X scenes", or a combination thereof. I just want to make sure the command-line syntax is correct or intuitive (I'm not sure I follow what the slice operator means in the first example?). I like the idea of breaking early as well, but am curious as to how you did it - feel free to post a pull request if you would like and link it to this issue. |
Understandable. If you think that this will be a significant speedbump for users, I'm open to other suggestions on how to accomplish the same thing with a more intuitive syntax.
I assume your confusion results from the In this case, Does that clear things up? |
|
Yes sorry @tonycpsu, I initially misunderstood your original post. Just wanted to make sure I fully understood the idea, looks good to me though. Only other comment I have is it would be nice to have a single-letter argument in addition to (Only because |
|
I used |
|
I'm not a huge fan of using capitalization to distinguish single-letter arguments, but if anyone feels strongly otherwise feel free to voice your opinion here. As @tonycpsu submitted the PR it uses |
Description of Problem & Solution
I've had some situations where I have a large number of video files with a similar structure where I'd like to select (or omit) a certain number of scenes from the output, either at the beginning or end of the file. These are generally Youtube downloads where the channel has a bunch of content at the beginning (title sequence) or end ("please like and subscribe!") that I'd rather not waste time saving and deleting.
It would be nice of
scenedetecthad a way to select these to avoid extra files being created.Proposed Implementation:
My proposal is to add a
--scenes(-S) option that takes a string in the form of a comma-separated list of array indexes or slices. These indexes and slices would be used to generate a list of array indexes for the detected scene list, and only those indexes would be output when runningsave-imagesorsplit-video.For example:
scenedetect -i input.mp4 --scenes 0,-3:would save the first scene and the last three scenes, while
scenedetect -i input.mp4 --scenes 5:-5would omit the first five and last 5 scenes.
In the case where the scene indexes are all positive (i.e. none of them depend on knowing how long the list is) my implementation of this also short-circuits the
detect-scenesprocess, stopping after it knows that there are no more scenes that will be kept. So-S 0runs extremely fast, breaking out of scene detection once it gets to the first cut, and just saving the images / video from the first scene.Knowing a priori what scenes are to be kept is a bit of a unique situation, so I don't know if this is anything anyone else would care to have, but I've already implemented it and it works for me (tm), so I'd be happy to submit a PR if there's any interest. Would just need to tidy it up and add docs.