Buy Me A Coffee

Hi !

Today I’ll share another cool Python library: moviepy.

And, as usual let’s share the code, the best way to explain part of this library capabilities

from moviepy.editor import VideoFileClip, clips_array, vfx
clip11 = VideoFileClip("cat1.mp4").margin(10)
clip21 = VideoFileClip("cat2.mp4").margin(10)
clip12 = clip11.fx( vfx.mirror_x)
clip22 = clip21.fx( vfx.mirror_y)
final_clip = clips_array([[clip11, clip21],
[clip12, clip22]])
final_clip.resize(width=480).write_videofile("stacked_vid.mp4")

Super, easy. It start with 2 cats videos, create 2 new videos with mirroring effects from the source videos, and create a final video with the 4 videos stacked. Let’s take a look at the final video

stacked_vid_5sec (2)

And, of course, this is video editing, so the process may take some time.

moviepy stack process on console

Check the official moviepy installation guide.

Bonus, source videos are here

Happy coding!

Greetings

El Bruno

More posts in my blog ElBruno.com.

More info in https://beacons.ai/elbruno



¿Con ganas de ponerte al día?

En Lemoncode te ofrecemos formación online impartida por profesionales que se baten el cobre en consultoría:

Leave a comment

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading