From b189b570267d1b6c057c4b4121c191d6f988fad8 Mon Sep 17 00:00:00 2001 From: katherine Date: Fri, 24 Mar 2017 01:23:39 -0700 Subject: initial commit --- Readme.md | 24 ++++++++ make-gif | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 226 insertions(+) create mode 100644 Readme.md create mode 100755 make-gif diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..73f470a --- /dev/null +++ b/Readme.md @@ -0,0 +1,24 @@ +make-gif +======== + +despite the recent rise of libvpx, there's still something magical about the +humble animated gif and it's status as not-quite-video-or-image. however, given +the limitations of the file format, creating gifs which can hold their own +against these modern video formats is not easy. + +this script aims to provide a featureful frontend to +[ffmpeg](https://ffmpeg.org/) which makes creating high-quality gifs from video +files as painless as possible, with support for things like embedding +subtitles, various dithering algorithms, cropping, and post-optimisation (via +[gifsicle](https://www.lcdf.org/gifsicle/)) + +just clone and run `make-gif --help` to get started! + +dependencies +============ + +in addition to being run via zsh, make-gif makes use the following external +commands: + +* **required**: `ffmpeg`, `ffprobe`, `grep` +* **optional**: `gifsicle` diff --git a/make-gif b/make-gif new file mode 100755 index 0000000..320a4a0 --- /dev/null +++ b/make-gif @@ -0,0 +1,202 @@ +#!/usr/bin/env zsh +# export a clip from a video as a gif + +local callstr="$0" +local hasgsic=$(whence gifsicle) + +print_error() { + echo -e "\e[1;31merror:\e[0m $1\n" +} + +usage() { + [[ "$1" != "" ]] && print_error $1 + echo "Usage: $callstr [OPTIONS...] " + echo "" + echo " description option default val" + echo " start time -s