Skip to content

Instantly share code, notes, and snippets.

@ivansaul
Last active November 10, 2020 17:53
Show Gist options
  • Save ivansaul/45e8c6bf1166107dec40a4c98ea72385 to your computer and use it in GitHub Desktop.
Save ivansaul/45e8c6bf1166107dec40a4c98ea72385 to your computer and use it in GitHub Desktop.
Split and Concat Videos With this Python Script

MoviePy

Source: MoviePy

Installation:

pip install moviepy

Python script:

from moviepy.editor import VideoFileClip, concatenate_videoclips
clip1 = VideoFileClip("myvideo.mp4")
clip2 = VideoFileClip("myvideo2.mp4").subclip(50,60)
clip3 = VideoFileClip("myvideo3.mp4")
final_clip = concatenate_videoclips([clip1,clip2,clip3])
final_clip.write_videofile("my_concatenation.mp4")

Another -> example

Video Splitter

Source: Video Splitter

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