Making a GIF using FFMPEG

First, open terminal install FFMPEG

brew install ffmpeg

Done!

Now cd over to the directory your videos are and run ffmpeg on the video you want to convert to a GIF. Something like this:

ffmpeg -ss 20.0 -t 3.0 -i 0303201545.mp4 -s 480x320 -f gif vid1.gif

This will seek (-ss) 20 seconds, then grab 3 seconds (-t) of the video, output (-s) as a 480×320 gif

Resulting File:

Animation of the process:

And the command to convert the screen cast from MOV to GIF and speed up the GIF:

ffmpeg -ss 0.0 -t 17.0 -i Screen\ Recording\ 2020-03-03\ at\ 4.54.25\ PM.mov -filter:v "setpts=0.1*PTS,scale=720:-1" -f gif howtoffmpeg.gif

setpts=0.1 speeds up the video

scale=720:-1 changes the scale of the video to 720 wide and keeps the aspect ratio of the video.

That’s it. The GIFs make uploading to the Crashspace WordPress blog easier.

3 thoughts on “Making a GIF using FFMPEG

  • December 6, 2020 at 3:25 pm
    Permalink

    Kevin , how i can do it with big video ? gif should be comprised of 10 ( or max available ) different screenshots across the videos length. So for example if a video is 30 minutes long a screenshot should be taken every 3 minutes and all the 10 screenshots should be turned into a gif.

    Reply
  • December 6, 2020 at 3:27 pm
    Permalink

    Hi , Kevin.

    How i can do gif should be comprised of 10 different screenshots across the videos length. So for example if a video is 30 minutes long a screenshot should be taken every 3 minutes and all the 10 screenshots should be turned into a gif ?

    Thanks

    Reply

Leave a Reply

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.