0

I am using moviepy to make a video of images. My code is below, and clip_path_list is a list of integers referring to the line number of the image (e.g [1,2,3,4]). These are all stored in a directory called genned_images. When I run this code, there is no error, but the output looks very strange for all images after a certain one. The first has a weird diagonal scrolling effect, and all the ones after are a few pixels off, but the pixels from the bottom wrap around. https://youtu.be/NGKMyqEMG3k?t=50

The images look fine.

clips = []
for file in clip_path_list:
    fpath = f"genned_images/{file}.png"
    clip = ImageSequenceClip(
         [fpath], durations=[3])
    clips.append(clip)

clip = concatenate_videoclips(clips)
clip.write_videofile("video_clips.mp4", fps=24)

Any help would be appreciated!

Status updates:

  1. I have tried setting fps in different places, and no changes!
  2. I have tried making multiple files and combining them, and that still leads to the same bug.
Westsi
  • 142
  • 2
  • 10

1 Answers1

0

My solution:

This seems to have been fixed by using

clip = concatenate_videoclips(clips, "compose", bg_color=None, padding=0)

I assume that the scrolling error was due to a disparity in the sizes of the images, and using compose fixes that.

Westsi
  • 142
  • 2
  • 10