Python: Convert GIF To video(mp4)

NaMo picture NaMo · Nov 21, 2016 · Viewed 8.6k times · Source

I am trying to find some way for converting GIF to mp4 using Python or library. I didn't found any solution for it. I found a library for generating gifs from videos but not the other way round.

Can anyone please give me some information on how to do it.

Answer

Inconnu picture Inconnu · Nov 21, 2016

Try MoviePy:

import moviepy.editor as mp

clip = mp.VideoFileClip("mygif.gif")
clip.write_videofile("myvideo.mp4")

If you don't have MoviePY installed then first install it:

pip install MoviePy