lundi 30 janvier 2023

moviepy using a ton of memory (Process finished with exit code 137 (interrupted by signal 9: SIGKILL))

for some reason this basic code takes a ton of memory then does Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

from moviepy.editor import *
import os
from random import randint, choice


def combineclips(mainvid,meme,t):
    clip1 = VideoFileClip(mainvid)
    clip = VideoFileClip(meme)
    return CompositeVideoClip([clip1, clip.set_position((randint(40,1040),randint(200,1720))).resize(250,250).set_start(t)])


for i in range(0,1):
    m = choice(os.listdir("memes/"))
    finalclip = combineclips(f"video/{i}.mp4",f"memes/{m}",i+3)
    finalclip.write_videofile(f"meme{i}.mp4")


It also dose not write the video at the end. I think I'm doing many things wrong here

I have tried not putting the clips in videofileclip format but that just makes it a wrong type error even though it is an mp4. and its probably not even the issue I'm pretty stumped here




Aucun commentaire:

Enregistrer un commentaire