Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 30, 2021 02:44 pm GMT

Convert video to gif in python

How to convert video file to gif format using Python programming language

  1. First install module
pip install MoviePy
  1. Now Code the following
from moviepy.editor import *clip = (VideoFileClip("./video1.mp4"))clip.write_gif("output.gif")

You can also trim the video from one part and then convert them into gif

from moviepy.editor import * clip = (VideoFileClip("./video1.mp4").subclip((0:00),(1:00)).resize(ACCORDING TO THE USER WISH)) clip.write_gif("output.gif")

Thanks for Reading
Image 1
If you like this article please like and leave us an comment


Original Link: https://dev.to/abipravi/convert-video-to-gif-in-python-464n

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To