A script for converting video files to GIF/APNG/WEBP using FFmpeg.
Go to file
2021-09-23 18:59:04 -06:00
.gitignore Video to GIF converter v1.0.0 2017-04-23 10:24:26 +04:30
gifenc.bat Add files via upload 2021-09-23 18:59:04 -06:00
LICENSE Initial commit 2017-04-23 03:28:48 +04:30
README.md Update README.md 2021-09-22 14:05:57 -06:00
sample.gif Add files via upload 2021-09-22 12:07:46 -06:00
sample.mp4 Video to GIF converter v1.0.0 2017-04-23 10:24:26 +04:30

video2gif

sample gif file generated

A batch script for converting video files to GIF files using FFmpeg on Windows.

Installation

  • Clone the repo
  • Install FFmpeg for Windows.
  • Make sure that the path to ffmpeg.exe is configured in your system environment variables control panel or that you run the gifenc.bat file in the same folder as ffmpeg.exe.

Usage

gifenc [input_file] [width_in_pixels] [framerate_in_Hz] [palettegen_mode] [Dithering_Algorithm]

Always make sure the current directory is the same as the one the video file is in, otherwise the conversion will fail.

Options:

Palettegen Modes:
      1: diff - only what moves affects the palette
      2: single - one palette per frame
      3: full - one palette for the whole gif
-----------------------------------------------------------------------------------------------
Dithering Options:
      1: bayer
      2: heckbert
      3: floyd steinberg
      4: sierra2
      5 sierra2_4a

Examples:

  gifenc sample.mp4 300 15 1 1
  gifenc sample.mp4 600 10 2 3
  gifenc sample.mp4 350 13 3 1

Tips

Special thanks to this article.