vid2ani/README.md

50 lines
1.9 KiB
Markdown
Raw Normal View History

2017-04-22 18:58:48 -04:00
# video2gif
![sample gif file generated](sample.gif)
2021-09-24 13:06:27 -04:00
A batch script for converting video files to GIF using FFmpeg on Windows.
## Installation
* Clone the repo
2021-09-24 13:11:31 -04:00
* Install [FFmpeg](https://www.ffmpeg.org/download.html#build-windows) for Windows.
2021-09-22 14:26:10 -04:00
* 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
```
2021-10-03 15:50:14 -04:00
gifenc [input_file] [width_in_pixels] [framerate_in_Hz] [palettegen_mode] [Dithering_Algorithm] [Bayer_Scale]
```
2021-09-22 14:44:10 -04:00
Always make sure the current directory is the same as the one the video file is in, otherwise the conversion will fail.
## Options:
```
2021-10-03 15:50:14 -04:00
-------------------------------------------------------------------------------------------------------------
2021-09-22 13:57:57 -04:00
Palettegen Modes:
2021-10-03 15:50:14 -04:00
1: diff - only what moves affects the palette
2: single - one palette per frame
3: full - one palette for the whole gif
-------------------------------------------------------------------------------------------------------------
2021-09-22 13:57:57 -04:00
Dithering Options:
2021-10-03 15:50:14 -04:00
1: Bayer
2: Heckbert
3: Floyd Steinberg
4: Sierra2
5: Sierra2_4a
6: No Dithering
-------------------------------------------------------------------------------------------------------------
When bayer dithering is selected, the Bayer Scale option defines the scale of the pattern (how much the crosshatch
pattern is visible). A low value means more visible pattern for less banding, and higher value means less
visible pattern at the cost of more banding.The option must be an integer value in the range [0,5].
The Default is 2.
Bayer Scale is optional and can only be enabled when using bayer dithering
```
2021-09-22 13:59:14 -04:00
## Examples:
```
2021-10-03 15:50:42 -04:00
gifenc sample.mp4 300 15 1 1 3
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
```
## Tips
Special thanks to [this article](http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html).