Member-only story

Make a GIF from a video with ffmpeg

Pietro Colombo
1 min readJul 3, 2021

--

In this article, I explain how to create a gif simply by using the terminal.

To install ffmpeg on the Mac:

brew install ffmpeg

If you don’t have Homebrew, look here to install it:

If you are using Linux:

sudo apt install ffmpeg

This is the command that takes the video and turns it into 3 seconds of gif at 5fps:

ffmpeg -i IMG_0118.MOV -t 3 -vf "fps=5" out.gif

This is the result from a 9 seconds video:

Image by author

This is the basic command, for other settings you can see in the help command

ffmpeg -h

If you have any problems or if you have solved them in any other way do not hesitate to write them in the comments!

To get access to unlimited stories, you can also consider signing up to become a Medium member for just $5. If you sign up using my link, I’ll receive a small commission.

--

--

Pietro Colombo
Pietro Colombo

Written by Pietro Colombo

Robotics and Software engineering

No responses yet