-
Notifications
You must be signed in to change notification settings - Fork 390
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
Transition CLI to 1-based Frame Numbers #265
Comments
Hi. Sorry, End frame from once scene cannot be the same start frame of the next scene. the Example above should be: scene 1 | start frame: 1 | end frame: 1 | duration frames: 1 |
In short, a frame cannot belong to two different scenes. |
@eksperimental Good point, thanks for the suggestion - that certainly helps the math work out easier as well. Just need to make sure that it's documented correctly. I had originally written that table in the form the internal API would see it, not the scene list output. Edit: I've clarified by showing both tables. |
Problem:
In PySceneDetect v0.5, frame numbers started from frame 0 in the CLI output. This led to some inconsistencies when interfacing with other programs (e.g. ffmpeg) which assume 1-based indices.
Proposal:
The reported end time/frame # should include the presentation time. Thus for a single-frame scene that is the first frame of the video, it should have start/end frames of 1/1 and a start/end time, assuming 10 FPS, of 0.0/0.1 seconds.
The first frame of a video should be called frame 1 with a presentation time of 0.0 seconds (and presentation duration of 0.1s). If we have a video at 10 frames/sec, the second frame (frame 2) should have a presentation time of 0.1s and be displayed until 0.2s. See the frames extracted from counter.mp4 for an example of such a video.
Example:
Assume we have a video at 10 frames/second, which is 0.7 seconds long in total (including the display time of the last frame), and has 4 scenes of length 1, 2, 1, and 3 frames, respectively. We should have the following invariants on the timecodes/frame numbers's that are output for each scene via the CLI /
list-scenes
:Number
(sec)
(frame)
(sec)
(frame)
(sec)
(frames)
See original discussion in #264 for more details.
Internally, the
scenedetect
API uses 0-based frame indexing. Thus the above scene list when returned from callingdetect_scenes
on aSceneManager
will yield the following FrameTimecode results (there is no change between 0.5 and 0.6):(timecode)
(frame)
(timecode)
(frame)
In the API, the first frame (PTS 0.0s) has a frame number of 0, and the end timecode object is reflective of the entire duration of the scene (thus
end - start = duration
).Tasks:
1
or> 0.0s
if a timecode1
or> 0.0s
if a timecodeThe text was updated successfully, but these errors were encountered: