Convert mp4/avi to gif but the gif is very slow

Question:

I use the below to convert my mp4 file to gif file. It worked fine but when I load the gif with browser or local tool, the gif is moving very slow. E.g. It was an animal moving from point A to point B, in the mp4, it moves like normal but when I converted it to gif, it moves 5times(estimate) slower than the mp4.

Code;

from moviepy.editor import VideoFileClip

videoClip = VideoFileClip("my-life.mp4")

videoClip.write_gif("my-life.gif") 
Asked By: Learner91

||

Answers:

try adding

(<your.gif>,fps=25,program='ffmpeg') or (<your.gif>,fps=25,program='imageio)

` videoClip.write_gif("my-life.gif", <one of the above goes here>")`
Answered By: Elijah Brown
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.