This content originally appeared on DEV Community and was authored by Praveen Kumar
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
This content originally appeared on DEV Community and was authored by Praveen Kumar
Praveen Kumar | Sciencx (2021-12-30T14:44:36+00:00) Convert video to gif in python. Retrieved from https://www.scien.cx/2021/12/30/convert-video-to-gif-in-python/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.