Search code examples
pythonmoviepy

Moviepy set ImageClip duration not working and duplicate clips beeing removed?


I am setting the duration of a imageClip, but it doesnt seem to care.

I am setting the duration of a imageClip, but it doesnt seem to care. When i try to add duplicate clips it doesnt register. Any help would be appreciated!

img = os.listdir(picDir)
rawClips = [ImageClip(str(picDir)+m).set_duration(2) for m in img]
clips = []
for i in rawClips:
    for x in range(imageDuration):
        clips.append(i)
print(len(clips))
music = AudioFileClip("music.mp3")

video = concatenate_videoclips(clips, method="compose")
#video.set_audio(music.set_duration(video.duration))

video.write_videofile('result.mp4', fps=120)
return send_file("result.mp4")

It should make every clip duration to 5, but i sets it to 1


Solution

  • It was a flask error, i have no idea how though