2

I'm looking for a tool (GUI would be best) to convert an animated gif to a mp4-video to send it via WhatsApp. Do you have any suggestions that get this job done?

  • 1
    if one of these answered you, can you click the check to close your question. – beroe May 1 '16 at 21:46
12

You can use two programs, Imagemagick's convert command and ffmpeg, to do this.

convert -coalesce animation.gif frames%04d.png

Then convert the pngs to a movie:

ffmpeg -r 10 -i frames%04d.png -vcodec mjpeg -y movie.mp4

For a GUI, it would not gain you much convenience, but I know QuickTime Pro (you might have to get the old version) will convert a stack of sequential images into an animation. I don't know if it will read the GIF properly.

Edit: see @Henry's answer for another codec using h264.

4

Beroe's answer was really helpful but I found that when I created mp4s using his method it didn't work on QT or iMovie on El Capitan. I did a little digging and read the encoding logs and stumbled upon this solution, seems to work with QT and iMovie:

ffmpeg -r 10 -i frames%04d.jpg -vcodec h264 -y -pix_fmt yuv420p movie.mp4

  • I think you need frames*.jpg or frames*.png rather than frames%04d.jpg – Mark Setchell Nov 17 '15 at 11:45
  • This worked for me after converting the gif to jpg's by using @beroe's method from his answer above: convert -coalesce animation.gif frames%04d.jpg – Andrei Dvoynos Feb 7 at 21:52
  • @MarkSetchell No he does mean frames%04d which is ffmpeg syntax for any file with four digits e.g. frames0001.png frames0002.png etc – Carlos P Apr 23 at 20:30
2

Despite using Mavericks, I still keep Quicktime 7 Pro Player on my disk. It is just fine for viewing animated GIFs and exporting them in other formats.

added

Requires Quicktime 7 (optional install, or keep it in your Applications when you install new versions of the OS). Requires the paid "Pro" upgrade key, Quicktime 7 version available since 2005 or so.

Open the GIF file with Quicktime Player 7. (Drag the GIF icon onto the Player icon; or right-click the GIF icon and choose Quicktime Player 7 under "Open with"; or start Quicktime Player 7, then use Open File... in theFile menu)

Play it to make sure it is working. You can use the left and right arrow keys to go forward or back one frame at a time.

Window > Show Movie Inspector (or ⌘-I). Write down the "Normal size", 270 x 600 or whatever it is

inspector

File > Export (or ⌘-E)

In the Export: menu choose Movie to MPEG-4 (or some other format if you wish)

export

Use the Options button to control some characteristics of the MP4 file. In particular, set the Image size (if the size you wrote down isn't in the menu, choose Custom and write it in). Try format MPEG-4 Improved. Click OK when you are finished with options.

options

Select the destination and filename for the MP4 file

Click Save

  • Hi, could I ask you to summarise the steps required to achieve this, as I think it's useful info that still may need further explaining for some users. – stuffe Jan 8 '14 at 15:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .