Skip to content

Split video based on CSV file #235

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

Closed
mrahmadt opened this issue Aug 28, 2021 · 5 comments · Fixed by #294
Closed

Split video based on CSV file #235

mrahmadt opened this issue Aug 28, 2021 · 5 comments · Fixed by #294
Assignees
Labels
Milestone

Comments

@mrahmadt
Copy link

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.

@wjs018
Copy link
Collaborator

wjs018 commented Aug 29, 2021

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.

@Breakthrough
Copy link
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.

@Breakthrough
Copy link
Owner

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

@wjs018 wjs018 linked a pull request Oct 25, 2022 that will close this issue
@wjs018
Copy link
Collaborator

wjs018 commented Oct 25, 2022

@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.

@wjs018 wjs018 self-assigned this Oct 25, 2022
@Breakthrough Breakthrough added this to the v0.6.2 milestone Jun 22, 2023
@Breakthrough
Copy link
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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants