2017-04-22 18:58:48 -04:00
|
|
|
# video2gif
|
2017-04-23 02:33:56 -04:00
|
|
|
|
|
|
|
![sample gif file generated](sample.gif)
|
|
|
|
|
|
|
|
A batch script for convert video to GIF files by FFmpeg.exe on Windows.
|
2017-04-22 20:05:13 -04:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
* Clone the repo
|
|
|
|
* Install [FFmpeg](http://ffmpeg.zeranoe.com/builds/) for Windows.
|
2021-09-22 13:57:57 -04:00
|
|
|
* Make sure the `ffmpeg.exe` and `gifenc.bat` are on your systems path.
|
2017-04-22 20:05:13 -04:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
```
|
2021-09-22 13:57:57 -04:00
|
|
|
gifenc [input_file] [width_in_pixels] [framerate_in_Hz] [palettegen_mode] [Dithering_Algorithm]
|
2017-04-23 01:54:26 -04:00
|
|
|
```
|
|
|
|
|
2017-04-23 02:33:56 -04:00
|
|
|
## Options:
|
2017-04-23 01:54:26 -04:00
|
|
|
```
|
2021-09-22 13:57:57 -04:00
|
|
|
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
|
2017-04-23 01:54:26 -04:00
|
|
|
```
|
|
|
|
|
2021-09-22 13:59:14 -04:00
|
|
|
## Examples:
|
2017-04-23 01:54:26 -04:00
|
|
|
```
|
2021-09-22 13:57:57 -04:00
|
|
|
gifenc sample.mp4 300 15 1 1
|
2021-09-22 13:59:14 -04:00
|
|
|
gifenc sample.mp4 600 10 2 3
|
|
|
|
gifenc sample.mp4 350 13 3 1
|
2021-09-22 13:57:57 -04:00
|
|
|
|
2017-04-23 01:54:26 -04:00
|
|
|
```
|
|
|
|
|
2017-04-22 20:05:13 -04:00
|
|
|
## Tips
|
|
|
|
Special thanks to [this article](http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html).
|