ffmpeg Tools Français

Convert a video to GIF

A GIF made with no tuning often has washed-out colors. This command first generates a palette suited to the video, then applies it: the result looks better at the same file size.

Updated on

  

How to use it

  1. Install ffmpeg if you haven't already.
  2. Open a terminal in the folder containing your file.
  3. Copy the generated command, adjust the file names if needed, then run it.
  4. Open the resulting file to check the result.

Why a palette?

A GIF is limited to 256 colors. Without a suitable palette, ffmpeg uses a generic one and the picture turns grainy. The command first creates a palette from the video (palettegen), then applies it (paletteuse): the result is truer to the original.

Reducing the size of the GIF

The size of a GIF depends mainly on its width, its frames per second and its duration. For messaging or social media, 480 pixels and 15 fps are enough. Trim the section you want first. For a long or detailed clip, a short MP4 is much smaller than a GIF.

Trim a video before converting it

Frequently asked questions

Why is my GIF so big?

GIF is an inefficient format. Reduce the width, the fps and above all the duration: trim the section you want first.

What does the -loop 0 option do?

It makes the GIF loop forever.

More tools