This is the current code i have and its too slow. I am a noobie programmer and have tried to use stuff like njit but it doesn't work. I need a script that merges multiple videos faster!
from moviepy.editor import *
import os
from functools import cache
@cache
def merge():
vidstmp = []
for x in os.listdir():
try:
if (x[0]).isnumeric():
vidstmp.append(int(x.replace('.mp4','')))
except:
pass
vidstmp.sort()
vids = []
for y in vidstmp:
vids.append(f'{y}.mp4')
clips= []
for x in vids:
video = VideoFileClip(x)
clips.append(video)
final_clip = concatenate_videoclips(clips)
final_clip.to_videofile("output.mp4", fps=24, remove_temp=True)