Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #235, #275, and #115 this is a frequently requested feature. I have put together a first pass at implementation based on @Breakthrough's outline in #275. I would not say this is in a complete state yet, but wanted to get some eyes on it and feedback as to how some of the details of this command should work. I have outlined the way it currently functions below:
The new detector (
load-scenes
command from the cli) is designed to use a csv file as input and detect scene transitions based on the scenes in the csv. It doesn't actually do any video or image analysis and it ignores things likemin_scene_len
or the use of aStatsManager
. It also isn't really meant to be used in conjunction with other detectors (though I haven't forbidden it yet). It's main use case is for manually editing a previously generated csv file to tweak the detected scenes and then using that to split the video based on the scenes in the csv file.The way this command currently works is that it reads the input csv file row by row and as the video is processed, when the current frame number is equal to the frame number of the next scene start (per the csv), then it "detects" a cut. This means that the csv must be in order from earliest scene to latest. Also, if the start time of the video is later than the first scene in the csv, it will not detect anything. @Breakthrough, is this desired behavior? If not, then I might need some help brainstorming how to change this.
Another important bit to mention is that this detector currently can't skip over unwanted scenes. This is something that was brought up in #275, but I am not sure how to (with the current api) mark scenes to be ignored. The detectors just produce a list of cuts. @Breakthrough I am guessing this is maybe an improvement for a future api change. EDIT: Just stumbled across #123 which is a relevant discussion for this point.
As a corollary to the above point, even if the input csv file doesn't have a scene starting at frame 1, this detector (like all the others), will include a scene the begins at the first frame and goes until the first detected cut (from the csv).
One final point is that currently the
--end-col
/-e
argument is not really used for anything. I debated just getting rid of it entirely, but some of the uses thought up in #275 would require it even though the current api (I don't think) supports them.This command is compatible with the csv file generated by the
list-scenes
command as long as the-s
flag is included (list-scenes -s
). Otherwise, the column headers are not read correctly and the csv file in general is not formatted in a way to programmatically parse. See #243 and #136 for discussion on this.If it isn't obvious by now, this isn't in a final form yet, but I wanted to get some feedback. I haven't updated any docs or tests yet but can do so if this starts to gel into something approaching a final form.