FFmpeg Cookbook
JA

Video to GIF Converter

Turn part of a video into an animated GIF. A color table (palette) is built for that part first, so banding is less likely. Width and FPS set the quality and the file size.

Your file is not uploaded
Drag & drop a video here, or click to select
Supported: MP4, MOV, AVI, MKV, WebM, and more / Max 200 MB
—
—
e.g. 5.5 = 5 seconds 500 ms
Max 30 s recommended (longer = larger file)
Height is calculated automatically
Converting… 0%

Equivalent FFmpeg command

CLI command for your current settings. Updates live as you change controls.

ffmpeg -ss 0 -t 5 -i input.mp4 -vf "fps=15,scale=320:-1:flags=lanczos,palettegen" palette.png
ffmpeg -ss 0 -t 5 -i input.mp4 -i palette.png -filter_complex "[0:v]fps=15,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif

Visual concept

Width × FPS dominate GIF file size 240×10fps ~ 1.5 MB 320×15fps ~ 4 MB (recommended) 480×20fps ~ 12 MB 640×25fps ~ 22 MB Approx for a 5-second clip; doubling duration roughly doubles size

* Actual results depend on source duration / complexity (illustrative example)

Popular uses
Short GIFs for chatAnimated blog previewsLooping social posts

How to use

  1. Pick a videoMP4, MOV, WebM and so on, up to 200 MB. Long videos are slow, so pick a short part.
  2. Set start / endEnter the range in seconds (60 seconds at most). Ten seconds or less keeps the file small.
  3. Pick width / FPSThe defaults are 320px and 15 fps, a balance of quality and size.
  4. ConvertPress "Convert to GIF". When the preview appears, download it.

Recommended settings

Slack / chat shareable
320px · 15fps · ≤10s
Keeps the file small.
Blog screencap
480–640px · 15fps · 5–8s
Large enough to read in an article.
Smooth short loop
240px · 20fps · ≤3s
A higher FPS needs a smaller width and a shorter clip to keep the size down.

When it goes wrong

The GIF is too big

Cause: The clip is long, the FPS is high, or the width is large.

Fix: Cut to 5–10s, 320px wide, 10–15fps.

Banding visible

Cause: A GIF frame can use only 256 colors. The palette is shared by the whole clip, so scenes with different colors compete for them.

Fix: Shorten the clip to one scene, or share it as MP4 instead.

Looks choppy

Cause: The FPS setting or the source FPS is too low.

Fix: Use 15 fps or more and check the source.

Questions

GIF or MP4 — which is smaller?

MP4, by a wide margin, for the same length and look. If the destination plays MP4, send the MP4.

Can I make a transparent GIF?

There is no transparency setting. Ordinary videos have no transparent areas, so the GIF is not transparent either. GIF transparency is only on or off, so for animation with soft, semi-transparent edges use APNG, WebP or WebM.

Why ≤30s recommendation?

The longer the range, the bigger the GIF and the more memory the conversion needs. The range can be up to 60 seconds.

What does palettegen do?

It looks at the colors in the range, builds a table of up to 256 colors that fit this video (the palette), and then makes the GIF with that table (palettegen and paletteuse). This gives less banding than a fixed color table.

Mobile?

Yes, but a warning appears for sources over 50 MB, because memory runs out more easily. Pick a shorter range, or trim or compress the video first.

GIF looks heavy / blurry on Slack or Discord

GIF is limited to 256 colors, so gradients suffer. Aim for 320px width and 10–15 fps. If it is still heavy, send an MP4 instead of a GIF.

Can I make it play once instead of looping?

Not in this tool: its GIFs always loop. With FFmpeg, change `-loop 0` to `-loop -1` in the command and the GIF plays once.

Does vertical / portrait video work?

Yes, the aspect ratio is kept. A 9:16 video at 320px wide becomes about 569px tall. If that is too tall, use 240px.

More detail (settings, limits, FFmpeg commands)

What each setting means

Start / End
The range to convert, in seconds. The longer it is, the bigger the file.
Width
GIF width: 240, 320, 480 or 640px. The height follows the aspect ratio.
FPS
Frames per second: 10, 15 or 20. More frames look smoother but make the file bigger.

Browsers and limits

  • Max 200MB input
  • 256-color limit (no smooth gradients)
  • Range up to 60 seconds (30 seconds or less recommended)

The same job with the FFmpeg command line

Basic GIF
ffmpeg -i input.mp4 -ss 5 -to 10 -vf "fps=15,scale=320:-1:flags=lanczos" -loop 0 output.gif
No palette is built, so a fixed set of 256 colors is used.
palettegen pipeline
ffmpeg -i input.mp4 -ss 5 -to 10 -vf "fps=15,scale=320:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse" -loop 0 output.gif
Builds a palette for the range, so banding is less likely. -loop 0 loops forever; -loop -1 plays once.

What to do next