So basically, my code is supposed to edit the videos in a given directory for the first 15 seconds, the middle 15 seconds, and the last 15 seconds. I'm on python 2.7 and i'm using the moviepy module.
import moviepy.editor as mp
from moviepy.editor import *
import os
for item in os.listdir(wildcard):
clip = VideoFileClip(vid + item)
dur = clip.duration
firstHalf = (dur/2.0) - 7.5
secHalf = (dur/2.0) + 7.5
end = dur - 15.0
clip1 = clip.subclip(0, 15.0)
clip2 = clip.subclip(firstHalf, secHalf)
clip3 = clip.subclip(end, int(dur))
video = mp.concatenate([clip1,clip2,clip3])
video.to_videofile(wildcard, fps=24, codec='mpeg4')
But I keep getting an error at the video = mp.concatenate() line. I'm not sure why, but it outputs the message "Errno 22: Invalid Argument."