Skip to content

Define minimum and maximum number of splits in split-video #393

Closed

Description

@hanoonaR

@Breakthrough,

Thank you for sharing your great work.

I have a question regarding the split-video functionality (scenedetect -i video.mp4 split-video). Is there a way to control the number of scenes or split? Like, set a minimum or maximum number of splits? Otherwise could you please suggest an alternative?

Thank you.

Activity

  1. Breakthrough commented on Apr 23, 2024

    @Breakthrough
    Owner

    Hi @hanoonaR;

    Controlling the number of splits would require some kind of resolution method to determine both where to add missing cuts, and also where to remove them. With the Python API this is certainly possible, since you can do whatever you would like with the resulting scene list before the video is split:

    from scenedetect import detect, ContentDetector, split_video_ffmpeg
    scene_list = detect('my_video.mp4', ContentDetector())
    # modify scene_list here
    split_video_ffmpeg('my_video.mp4', scene_list)

    As an example, you could combine the shortest scenes together until you have the desired amount.

    You could also use minimum scene length and detect only a certain portion of the video to limit the maximum number of scenes. For example if you set minimum scene length to 1 second and limit the processing duration to 10s, there can never be more than 10 scenes detected.

    To add this as an official feature however, we need to look into how it will be used, so the right method can be chosen. There are also some open questions. For example, where should the cuts be placed if we didn't find any? Could you share more about your use case?

    Thanks for the comment/idea, glad you're finding the project useful!

  2. Repository owner locked and limited conversation to collaborators on May 1, 2024
  3. converted this issue into a discussion #396 on May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions