Skip to content

Instantly share code, notes, and snippets.

@MrValdez
Created September 27, 2019 23:51
Show Gist options
  • Save MrValdez/77a2e369dabddf131e43a78fd05f8e16 to your computer and use it in GitHub Desktop.
Save MrValdez/77a2e369dabddf131e43a78fd05f8e16 to your computer and use it in GitHub Desktop.
create clips from long videos
from moviepy.editor import *
output = "output.mp4"
# filename, start, end
files = [
(
"DRAGON BALL FighterZ 2019-09-22 22-25-58",
(3, 50),
None
),
]
clips = []
for filename, start, end in files:
filename += ".mp4"
clips.append(VideoFileClip(filename).subclip(start, end))
concatenate_videoclips(clips).write_videofile(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment