Buy Me A Coffee

Hi !

Today I’ll share another cool sample using moviepy.

This one is easy: create a gif from a video file. And in this scenario, I added some extra features

  • Use the Video frames from seconds 1 to 5
  • Resize the output to 50% of the original file

The code is super simple

from moviepy.editor import VideoFileClip, clips_array, vfx
clip = (VideoFileClip("cat1.mp4")
.subclip(1,5)
.resize(0.5))
clip.write_gif("cats can be friendly.gif")

Super, easy. It and the output is a 2MB gif file.

cats can be friendly animated gif

Source video, the full version is 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