0

I'm trying to download clips online and merge them into one video, but I get this error, not sure why this is happening:

Traceback (most recent call last):
File "C:/Users/myalt/OneDrive/Desktop/pythonProject1/main.py", line 78, in <module>
merge()
File "C:/Users/myalt/OneDrive/Desktop/pythonProject1/main.py", line 56, in merge
video = concatenate_videoclips(clips, method='compose')
File "C:\Users\myalt\OneDrive\Desktop\pythonProject1\venv\lib\site-packages\moviepy\video\compositing\concatenate.py", line 75, in concatenate_videoclips
w = max(r[0] for r in sizes)
ValueError: max() arg is an empty sequence
def merge():
    clips = []
    clipPaths = []  # If you want to store the paths as well
    for filename in os.listdir(r'clips//'):
        # clips.append(filename)
        clip = VideoFileClip(f'clips//{filename}')
        clips.append(clip)
        clipPaths.append(filename)

    video = concatenate_videoclips(clips, method='compose')
    video.write_videofile('Merged.mp4', fps=30)
mkrieger1
  • 19,194
  • 5
  • 54
  • 65
8auuuuuer
  • 51
  • 5
  • This isn't supposed to be sarcastic, but what exactly do you not understand about the explanation the error message is giving you? `max() arg is an empty sequence` – mkrieger1 Dec 24 '20 at 00:12
  • Have you inspected the value of the `clips` variable before passing it to `concatenate_videoclips`? – mkrieger1 Dec 24 '20 at 00:14

0 Answers0