Skip to content
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

Incorrect end timecode when last scene is 1 frame long #307

Closed
Breakthrough opened this issue Jan 18, 2023 · 0 comments
Closed

Incorrect end timecode when last scene is 1 frame long #307

Breakthrough opened this issue Jan 18, 2023 · 0 comments
Labels
Milestone

Comments

@Breakthrough
Copy link
Owner

Breakthrough commented Jan 18, 2023

When the last scene contains a single frame, the resulting scene list reports the same timecode for both the start/end frames. This is technically incorrect as it results in a duration of zero. This only affects the final scene in the scene list when the scene only consists of a single frame.

The changes described in #242 and #265 led to some significant changes to internal timekeeping, so this may have been introduced then. This was reported by voidwalker on discord.

The following test case demonstrates the desired behaviour:

def test_scene_list_one_frame(test_video_file):
    """Test SceneManager get_scene_list method with VideoStreamCv2/ContentDetector."""
    video = VideoStreamCv2(test_video_file)
    sm = SceneManager()
    sm.add_detector(ContentDetector())
    sm.auto_downscale = True
    sm.detect_scenes(video=video, end_time=0)
    start, end = sm.get_scene_list(start_in_scene=True)[0]
    assert (start + 1) == scene_list[0][1]

The assertion currently fails because start == end currently.

@Breakthrough Breakthrough added this to the v0.6.2 milestone Jan 18, 2023
Breakthrough added a commit that referenced this issue Jul 21, 2023
Reported on Discord, suspected to be due to #307. This function
should still be guarded against arbitrary inputs however.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant