How to convert video file
to gif
format using Python programming language
- First install module
pip install MoviePy
- 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
If you like this article please like and leave us an comment
Top comments (0)