Last active
April 23, 2018 14:58
-
-
Save twobob/365c8b212c307b42e8fcb441fe3379e6 to your computer and use it in GitHub Desktop.
Merge all MP4's in a directory using MoviePy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import os.path | |
from moviepy.editor import * | |
dir = '.' | |
files = glob.glob(os.path.join(dir, '*.mp4')) | |
L=list() | |
#print (len(files)) | |
for file in files: | |
L.append(VideoFileClip(file,audio=True)) | |
final_clip = concatenate_videoclips(L,method="compose") | |
final_clip.write_videofile("merged.mp4") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment