Skip to content

A script for converting video files to GIF/APNG/WEBP using FFmpeg.

License

Notifications You must be signed in to change notification settings

Pathduck/vid2ani

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vid2ani

Video to GIF/APNG/WEBP converter

sample webp file

A batch script for converting video files to GIF/APNG/WEBP using FFmpeg.

By MDHEXT, Nabi KaramAliZadeh, Pathduck

Based on the research listed here: High quality GIF with FFmpeg

Installation

Usage

vid2ani [input_file] [arguments]

Arguments

  -o  Output file. Default is the same as input file, sans extension
  -t  Output file type: 'gif' (default), 'apng', 'png', 'webp'
  -r  Scale or size. Width of the animation in pixels
  -l  Enable lossy WebP compression and quality, range 0-100 (default 75)
  -f  Framerate in frames per seconds (default 15)
  -c  Maximum colors usable per palette, range 3-256 (default 256)
  -s  Start time of the animation (HH:MM:SS.MS)
  -e  End time of the animation (HH:MM:SS.MS)
  -d  Dithering algorithm to be used (default 0)
  -b  Bayer Scale setting, range 0-5 (default 2)
  -m  Palettegen mode: 1 (diff, default), 2 (single), 3 (full)
  -k  Enables paletteuse error diffusion
  -p  Opens the resulting animation in the default image viewer
  -v  Set FFmpeg log level (default: error)

Dithering Algorithms
  0: None
  1: Bayer
  2: Heckbert
  3: Floyd Steinberg
  4: Sierra2
  5: Sierra2_4a
  6: Sierra3
  7: Burkes
  8: Atkinson

Palettegen Modes
  1: diff - only what moves affects the palette
  2: single - one palette per frame
  3: full - one palette for the whole animation

About Bayerscale
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.

Notes

  • The script will attempt to check for valid inputs, but will fall back to FFmpeg's error messages.

  • The APNG muxer does not support multiple input palettes, palettegen (-m) will fall back to using diff mode if single mode is selected.

  • Since FFmpeg can convert between any format, it's also possible to convert between for instance GIF to WEBP, although frame rates might be off.

  • The script uses ffmpeg, you can download that here: FFmpeg

  • The script was forked from: MDHEXT/video2gif

About

A script for converting video files to GIF/APNG/WEBP using FFmpeg.

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •