Animated gif to avi on linux

Fzs2 picture Fzs2 · Jul 9, 2010 · Viewed 35.5k times · Source

Is there any way to convert an animated gif to a video format (e.g. .avi) on Linux?

I have already tried

ffmpeg -i thegif.gif thevideo.avi

but all I get is the first image of the video.

Answer

Nordic Mainframe picture Nordic Mainframe · Jul 9, 2010

ffmpeg's gif input doesn't work too well. It's usually easier to unpack the gif frames with convert (from ImageMagick) and process these with ffmpeg:

convert some.gif some%05d.png  
ffmpeg -i some%05d.png some.avi  
rm some*.png