Skip to content

Split video based on CSV file #235

Closed

Description

@mrahmadt

Hi

I'm using PySceneDetect command line to generate a list of scenes, so far the result is good but some of my scenes are detected as multiple scenes.

I was thinking, is there a way to just modify the csv file generated from list-scenes (edit start/end of the frame or the timecode) and feed the csv file back again to the split-video function?

PS: I know about option -s, but it will not work in my case, some time I want to merge 2-3 actual scenes into one video during the split.

Activity

  1. wjs018 commented on Aug 29, 2021

    @wjs018
    Collaborator

    Are you manually modifying the csv file and then wanting to feed that csv back to the program to split the video? As the software is now, I don't think that is possible via command line, you would have to use the python api. You would have to feed the start and end timecodes for each scene to either the split_video_mkvmerge (ref) or split_video_ffmpeg (ref) function depending on your environment. These python functions are really just wrappers around command line functions using either mkvmerge or ffmpeg. So, a bit of bash scripting could bridge the gap without having to dip into the python api.

    An option if you want to stick with python would be moviepy by importing the video file and specifying a subclip using the start and end timecodes docs. Then, save the subclip to file docs.

    This does seem like a decent feature idea though...basically feed it a scene list that you might have modified using some external means and then let it do the splitting based on that csv. Tagging @Breakthrough to see if this would be in scope or not.

  2. Breakthrough commented on Sep 4, 2021

    @Breakthrough
    Owner

    I think this would be feasible enough - an option could be added to split-video pointing it to a scene .csv file that contains the required splits. For now though as you said @wjs018 it might be better to just hack something together in Python that loads the scenes from the CSV and calls split_video_ffmpeg directly, just since there's so much in the backlog right now... However this might be a good first issue for a new contributor to tackle.

  3. Breakthrough commented on Jul 16, 2022

    @Breakthrough
    Owner

    See #275 for a further discussion of a possible approach to implementing this.

  4. linked a pull request that will close this issueSplit video based on csv file #294on Oct 25, 2022
  5. wjs018 commented on Oct 25, 2022

    @wjs018
    Collaborator

    @mrahmadt Just wanted to let you know that I took a first pass at implementing this. See #294 for usage and limitations. Let me know if you have any feedback.

  6. self-assigned this
    on Oct 25, 2022
  7. added this to the v0.6.2 milestone on Jun 22, 2023
  8. Breakthrough commented on Jul 5, 2023

    @Breakthrough
    Owner

    This will be included in v0.6.2 as the load-scenes command (docs). Thanks @wjs018 for kicking off the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions