2017-04-23 03:28:48 +04:30
|
|
|
# video2gif
|
2017-04-23 11:03:56 +04:30
|
|
|
|
2023-08-11 23:12:10 +02:00
|
|
|
Video to GIF/APNG/WEBP converter v5.5
|
|
|
|
A batch script for converting video files to GIF/APNG/WEBP using FFmpeg on Windows.
|
|
|
|
(C) 2017-2022, MDHEXT & Nabi KaramAliZadeh <nabikaz@gmail.com>
|
2017-04-23 11:03:56 +04:30
|
|
|
|
2023-08-11 23:12:10 +02:00
|
|
|

|
2017-04-23 04:35:13 +04:30
|
|
|
|
2023-08-11 23:12:10 +02:00
|
|
|
## Installation
|
2017-04-23 04:35:13 +04:30
|
|
|
* Clone the repo
|
2021-09-24 11:11:31 -06:00
|
|
|
* Install [FFmpeg](https://www.ffmpeg.org/download.html#build-windows) for Windows.
|
2023-08-11 23:12:10 +02:00
|
|
|
* Make sure that the path to `ffmpeg.exe` is
|
|
|
|
[configured in your system environment variables control panel](https://www.wikihow.com/Install-FFmpeg-on-Windows)
|
|
|
|
or that you run the `gifconv.bat` file in the same folder as `ffmpeg.exe`.
|
2017-04-23 04:35:13 +04:30
|
|
|
|
2023-08-11 23:12:10 +02:00
|
|
|
## Usage
|
2017-04-23 04:35:13 +04:30
|
|
|
```
|
2023-08-11 23:12:10 +02:00
|
|
|
gifconv [input_file] [arguments]
|
2017-04-23 10:24:26 +04:30
|
|
|
```
|
2023-08-11 23:12:10 +02:00
|
|
|
## Arguments
|
2017-04-23 10:24:26 +04:30
|
|
|
```
|
2023-08-11 23:12:10 +02:00
|
|
|
-t Specifies output filetype - supported types: 'gif', 'png', 'webp'.
|
|
|
|
The default is 'gif'.
|
|
|
|
-o Specifies output filename.
|
|
|
|
Will be output to the same directory as your input video.
|
|
|
|
The default is the same as the input video.
|
|
|
|
-r Specifies scale or size.
|
|
|
|
Width of the animation in pixels.
|
|
|
|
The default is the same scale as the original video.
|
|
|
|
-f Specifies framerate in frames per second.
|
|
|
|
The default is 15.
|
|
|
|
-m Specifies one of the 3 modes listed below.
|
|
|
|
The default is diff.
|
|
|
|
-d Specifies which dithering algorithm to be used.
|
|
|
|
The default is 1 (Bayer).
|
|
|
|
-b Specifies the Bayer Scale. (Optional)
|
|
|
|
This can only be used when Bayer dithering is applied.
|
|
|
|
See more information below.
|
|
|
|
-s Specifies the start of the animation in HH:MM:SS.MS format.
|
|
|
|
(Optional)
|
|
|
|
-e Specifies the duration of the animation in seconds.
|
|
|
|
(Optional)
|
|
|
|
-c Sets the maximum amount of colors useable per palette.
|
|
|
|
(Optional value up to 256)
|
|
|
|
This option isn't used by default.
|
|
|
|
-k Enables error diffusion.
|
|
|
|
(Optional)
|
|
|
|
-p Opens the resulting animation in your default Photo Viewer.
|
|
|
|
(Optional)
|
|
|
|
|
2021-12-10 14:08:28 -07:00
|
|
|
Palettegen Modes:
|
|
|
|
1: diff - only what moves affects the palette
|
|
|
|
2: single - one palette per frame
|
2023-08-11 23:12:10 +02:00
|
|
|
3: full - one palette for the whole animation
|
|
|
|
|
2021-12-10 14:08:28 -07:00
|
|
|
Dithering Options:
|
|
|
|
1: Bayer
|
|
|
|
2: Heckbert
|
|
|
|
3: Floyd Steinberg
|
|
|
|
4: Sierra2
|
|
|
|
5: Sierra2_4a
|
|
|
|
6: No Dithering
|
2023-08-11 23:12:10 +02:00
|
|
|
|
2021-12-10 14:08:28 -07:00
|
|
|
About Bayerscale:
|
2023-08-11 23:12:10 +02:00
|
|
|
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, a 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.
|
2017-04-23 10:24:26 +04:30
|
|
|
```
|
|
|
|
|
2023-08-11 23:12:10 +02:00
|
|
|
## Examples
|
2017-04-23 10:24:26 +04:30
|
|
|
```
|
2021-11-03 22:53:26 -06:00
|
|
|
gifconv sample.mp4
|
|
|
|
gifconv sample.mp4 -f 20 -r 450
|
|
|
|
gifconv sample.mp4 -s 5:40 -e 5
|
2021-12-07 23:31:31 -07:00
|
|
|
gifconv sample.mp4 -o babydance -m 2 -k -b 3
|
2017-04-23 10:24:26 +04:30
|
|
|
```
|
|
|
|
|
2017-04-23 04:35:13 +04:30
|
|
|
## Tips
|
2023-08-11 23:12:10 +02:00
|
|
|
You can download this fork from here:
|
|
|
|
[MDHEXT/video2gif](https://github.com/MDHEXT/video2gif)
|
|
|
|
You can download the original release here:
|
|
|
|
[NabiKAZ/video2gif](https://github.com/NabiKAZ/video2gif)
|
|
|
|
This tool uses ffmpeg, you can download that here:
|
|
|
|
[FFmpeg Windows builds](https://www.ffmpeg.org/download.html#build-windows)
|
|
|
|
This tool wouldn't be possible without the research listed here:
|
|
|
|
[High quality GIF with FFmpeg](https://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html)
|
|
|
|
|