You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am generating a significant number of images and writing them to disk. I then pass an array of the filenames to ImageSequenceClip. A major bottleneck is writing the images down to disk; is there a way to keep the images in memory then pass that to ImageSequenceClip, subsequently avoiding the time necessary to write/read to disk?
The snippet you provide doesn't allow me to give the best answer. There are many ways to do this in MoviePy, e.g. using VideoClip or ImageSequenceClip:
def make_frame(t):
return some_numpy_array # corresponding to the frame to display at time t
clip = VideoClip(make_frame, duration).set_fps(20)
clip.write(videofilename)
or
frames = []
for i in range(50):
frames.append(some_frame) # some_frame is a numpy array of an image
clip = ImageSequenceClip(frames, fps=20)
clip.write(videofilename)
I am generating a significant number of images and writing them to disk. I then pass an array of the filenames to
ImageSequenceClip
. A major bottleneck is writing the images down to disk; is there a way to keep the images in memory then pass that toImageSequenceClip
, subsequently avoiding the time necessary to write/read to disk?The text was updated successfully, but these errors were encountered: