0

I'm adding clips to a main clip:

final_clip = VideoFileClip('video.mp4')
secondary_clip = VideoFileClip('video2.mp4')
for tr in time_ranges:
        clip = secondary_clip.subclip(tr['start'], tr['end']).set_position((0, 0))
        final_clip = concatenate_videoclips([final_clip.subclip(
            0, tr['end']), clip, final_clip.subclip(tr['end'], final_clip.duration)], method="compose")

Problem is that the video is 1GB+ and is 35 minutes long, so it barely renders on my laptop. Any suggestions to make it faster?

Thoughts I had:

  • Try to use something different than "compose" (I need the secondary clip to be fullscreen).
  • Parallelize it and concat the operations later.
funerr
  • 7,212
  • 14
  • 81
  • 129

1 Answers1

0

Figured it out.

The method="compose" was the culprit of the slowness. My videos were not the same size so I initially used compose to fix that. Now I just fed the concat same size videos and it is 10x faster.

Hope this helps.

funerr
  • 7,212
  • 14
  • 81
  • 129