32 votes

How do I convert a video to GIF using ffmpeg, with reasonable quality?

The answer from @Stephane is very good. But it will get a warning like Buffer queue overflow, dropping. for some video, and the generated gif has some frame dropped. Here is a better version with ...
alijandro's user avatar
  • 421
26 votes

Reduce Generated GIF Size Using FFMPEG

The standard way to use ffmpeg for GIFs is Generate a palette from the video ffmpeg -y -i file.mp4 -vf palettegen palette.png Then, ffmpeg -y -i file.mp4 -i palette.png -filter_complex paletteuse ...
Gyan's user avatar
  • 36.4k
26 votes
Accepted

Do 60 FPS GIF's actually exist? Or is the maximum 50 FPS?

The GIF98a specification says in the section about the Graphics Control Extension vii) Delay Time - If not 0, this field specifies the number of hundredths (1/100) of a second to wait before ...
dirkt's user avatar
  • 16.9k
25 votes

Reduce Generated GIF Size Using FFMPEG

Below command helped me optimising my gif's. The parameters can change based on your specific requirements. ffmpeg -y -i input.mp4 -filter_complex "fps=5,scale=480:-1:flags=lanczos,split[s0][s1];[...
Appu Mistri's user avatar
21 votes

How do I convert a video to GIF using ffmpeg, with reasonable quality?

Linux/Unix/macOS Following @LordNeckbeard approach with ffmpeg command, please find the following useful Bash function which can be added into your ~/.bash_profile file: # Convert video to gif file. # ...
kenorb's user avatar
  • 25.4k
18 votes

How can I get ffmpeg to convert a .mov to a .gif?

ffmpeg -i <input source> -filter_complex "[0:v] fps=12,scale=<width>:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" <output file> In this command there are 3 tokens you need ...
RyanHirsch's user avatar
18 votes
Accepted

How do I resize an animated GIF and keep transparency?

I upgraded from 3.4.1 to 4.0.2 and it worked. However, I got better results with >ffmpeg -hide_banner -v warning -i logo.gif -filter_complex "[0:v] scale=320:-1:flags=lanczos,split [a][b]; [a] ...
Chloe's user avatar
  • 5,976
17 votes

How do I convert a video to GIF using ffmpeg, with reasonable quality?

The selected answer assumes you wish to scale the source video and change its fps in the gif produced. If you do not need to do this, the following works: src="input.flv" dest="output.gif" palette="/...
Jet Blue's user avatar
  • 287
16 votes
Accepted

Adjusting gif framerate in GIMP 2

Just click on the As Animation checkbox - it will enable the animation options (and actually save an animation, instead of a flatenned GIF image) That is your answer - but taking the opportunity of ...
jsbueno's user avatar
  • 863
15 votes

How do I convert a video to GIF using ffmpeg, with reasonable quality?

The ffmpeg with palette method can be run in a single command, without intermediary .png file. ffmpeg -y -ss 30 -t 3 -i input.flv -filter_complex \ "fps=10,scale=320:-1:flags=lanczos[x];[x]split[x1][...
Stephane's user avatar
  • 161
15 votes
Accepted

How to control gif loop settings in FFmpeg

Use the -loop option for the GIF muxer ffmpeg -i input -loop 2 output.gif -1 no loop (plays once) 0 infinite loop (default) 1 loop once (plays 2 times) 2 loop twice (plays 3 times) etc See ffmpeg -h ...
llogan's user avatar
  • 59.6k
12 votes
Accepted

How can I convert animated gif to animated webp?

ImageMagick doesn't have the ability to convert animated GIF to WebP. For this you should consider Google's gif2webp. Google support page for gif2webp: https://developers.google.com/speed/webp/docs/...
Kinnectus's user avatar
  • 10.7k
12 votes

Do 60 FPS GIF's actually exist? Or is the maximum 50 FPS?

Using ffmpeg, this is the basic format to emulate a rolling average of 60 fps ffmpeg -i video.mp4 -vf "settb=1/100,setpts='if(eq(N,0),0,if(not(mod(N,3)),PREV_OUTPTS+1,PREV_OUTPTS+2))'" -vsync vfr -r ...
Gyan's user avatar
  • 36.4k
11 votes

Reduce Generated GIF Size Using FFMPEG

I tried all these techniques and I ended up using https://ezgif.com I have no idea what magic they're using under the hood, but their compression level knob, palette optimization and resolution ...
ubershmekel's user avatar
11 votes

How can I get ffmpeg to convert a .mov to a .gif?

I made a tool that bundles FFmpeg, ImageMagick and giflossy into a single easy to use command line program that you can install in one line: Abandonware: gifify I recommend anyone willing to turn ...
vvo's user avatar
  • 1,479
11 votes
Accepted

Batch convert WebP files to GIF files offline?

ImageMagick is cross-platform command line utility that can batch convert images from one format to another. You can download the latest versions here. Once installed, ensure that ImageMagick is ...
Anaksunaman's user avatar
  • 17.3k
10 votes

Pausing a .gif animation in Google Chrome

There's a great extension for this: Gif Scrubber! Allows stepping, exploding to see all individual frames (so frame download), with simple shortcuts. (not in any way affiliated, just stoked it works ...
ptim's user avatar
  • 1,386
9 votes

How do I convert a video to GIF using ffmpeg, with reasonable quality?

For Windows users: create a file \Windows\video2gif.bat with this content: @echo off set arg1=%1 set arg2=%arg1:~0,-4% ffmpeg -y -i %arg1% -vf fps=10,scale=-1:-1:flags=lanczos,palettegen %TEMP%\...
Nabi K.A.Z.'s user avatar
9 votes

Capture CLI Output as Animated GIF

You can recording your terminal with asciinema and then pass it through a2gif.
ku1ik's user avatar
  • 446
8 votes
Accepted

How do I resize an animated GIF using nearest-neighbor interpolation?

I used Gifsicle to do this. You can install it with homebrew. brew install gifsicle Then, to resize an image using nearest-neighbor interpolation, run gifsicle --resize 512x512 --resize-method ...
Tim Swast's user avatar
  • 251
7 votes

How can I get ffmpeg to convert a .mov to a .gif?

ffmpeg -y -i input.mp4 -f image2pipe -vcodec ppm - | convert -delay 2 -loop 0 -layers Optimize - gif:- | gifsicle -d 3 -O3 -o optimized.gif first use ffmpeg to convert mp4 file to images via pipe ...
Shuman's user avatar
  • 241
7 votes

How do I convert a video to GIF using ffmpeg, with reasonable quality?

ffmpeg commands: Run this command so that ffmpeg can figure out a good palette: ffmpeg -y -i foo.mp4 -vf fps=30,scale=320:-1:flags=lanczos,palettegen palette.png Run this command to convert the ...
Aphex's user avatar
  • 211
7 votes
Accepted

How to completely remove audio channels from video

Using FFmpeg its really simple: ffmpeg -i videoAndAudio.mp4 -c copy -an onlyVideo.mp4 -i path/to/input_file: give the path to your file -c copy: tell FFmpeg to copy codecs (prevent transcoding) -...
Dimitri Podborski's user avatar
6 votes

Reduce Generated GIF Size Using FFMPEG

vid= start_time=00:00:01 duration=5 height=ih/2 # input height halved , can replace with pixils . width=-2 # keeps aspect ratio . can replace with pixils . fps=25 ...
abc's user avatar
  • 154
6 votes

How to make a GIF loop endlessly in Microsoft PowerPoint

First, ensure you are inserting the GIF the way Microsoft recommends. This method is relevant for PowerPoint 2016, PowerPoint 2013 and PowerPoint 2010. Select the slide that you want to add the ...
MechtEngineer's user avatar
6 votes
Accepted

How can I limit the number of colors used in a GIF file while converting a MP4 to a GIF with FFmpeg?

Use max_colors and reserve_transparent options in palettegen: ffmpeg -i input.mp4 -vf "fps=16,scale=160:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=32:reserve_transparent=0[p];[s1][p]...
llogan's user avatar
  • 59.6k
5 votes

Animated GIF as an overlay in FFMPEG?

try this : ffmpeg -i test.mp4 -ignore_loop 0 -i loop.gif -filter_complex "[0][1]overlay=0:H-100" output.mp4
Ahmad Ali Mukashaty's user avatar
5 votes

How do I convert a video to GIF using ffmpeg, with reasonable quality?

How to add a windows 7/10 "right-click" context menu entry to convert your video file to gif Some of the other answers mentioned the video2gif script, which I used. But, you could use any ...
chris's user avatar
  • 191
5 votes

Convert animated gif to animated webp using FFmpeg

to complement @abvarun226 answer: use yuva420p instead of yuv420p to add alpha channel and keep transparency. ffmpeg -i transparent.gif -vcodec webp -loop 0 -pix_fmt yuva420p transparent.webp and to ...
Beerbill's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible