Skip to content
Advertisement

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

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") 

Advertisement

Answer

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>")`
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement