Video to GIF – quick and dirty
Published by António Lopes on December 24, 2014
Categories: Apple, DIY, Geek, Mac, Technology, Videos

Tl;dr

ffmpeg -i input_file.mov -vf scale=640:-1 -t 10 -r 10 output_file.gif

For more details, read below.

Why GIFs?

I don’t like video tutorials. They force a certain rhythm to the viewer that may be undesirable. Sometimes it’s too fast and you don’t have time to assimilate the transmitted knowledge, other times it’s too slow and you get bored.

Text-based tutorials, on the other hand, don’t have this problem. But they do lack the simplicity of the visual aid of a video tutorial. So what’s the solution? In my opinion: text-based tutorials interleaved with GIFs showing the most relevant UI actions.

Why does this make sense? Because users can take their time reading the text and hop back and forth between the tutorial and the testing environment without the constant need to pause a video. And when text just doesn’t cut it to explain a certain UI action, a GIF is there to save the day in its native glory of ever-looping quick snippets of video. Think about it: GIFs don’t have to be paused and if you didn’t catch the important bits on the first try, don’t worry, you can try again on the second/third/nth loop. Also, no complicated requirements on the browser. Every browser supports GIF (well, not all of them, but you get my point).

What do you need?

Basically? FFmpeg. That’s it. If you don’t have it, download it and install it. Quick way? Just brew it.

How to convert a video into a GIF?

Just open up Terminal, and use this command:

ffmpeg -i input_file.mov -vf scale=640:-1 -t 10 -r 10 output_file.gif

  • -i allows you to specify your input file, i.e., the video file
  • -vf allows you to specify the video filters. In this example, forcing a scale to a width of 640px and the -1 to let FFmpeg automatically adjust the height
  • -t 10 forces a 10 second clip
  • -r 10 forces a frame rate of 10fps
  • finally you specify the output file, i.e., the GIF file

That looks complicated. Could you show a GIF of the process?

Sure:

Video to GIF using FFmpeg

Comments

There are no comments for this post yet.

Comment this post

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.