diff options
author | Nicholas Van Doorn <vandoorn.nick@gmail.com> | 2021-08-04 18:12:54 -0700 |
---|---|---|
committer | Nicholas Van Doorn <vandoorn.nick@gmail.com> | 2021-08-17 10:47:48 -0700 |
commit | 6af4ba943f6b73e31a0b2bd0262d953a2e954ddb (patch) | |
tree | 0cf7b1d160d0671eeacb66004433b63572b96ebd /bin/togif |
Initial commit
Diffstat (limited to 'bin/togif')
-rwxr-xr-x | bin/togif | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/togif b/bin/togif new file mode 100755 index 0000000..02bd824 --- /dev/null +++ b/bin/togif @@ -0,0 +1,13 @@ +#!/usr/bin/env zsh +if [ "$#" -ne 3 ]; then + echo "Usage: togif <input file> <output file> <scale>\n" + echo "Example with 500px width and auto height:\n" + echo " \$ togif myinput.mov myoutput.gif 500:-1" + exit -1 +fi + +TEMP_FOLDER=/tmp/gifconvert-$(date) +mkdir $TEMP_FOLDER +ffmpeg -i $1 -vf scale=$3 -r 10 $TEMP_FOLDER/ffout%3d.png +convert -delay 8 -loop 0 $TEMP_FOLDER/ffout*.png $2 +rm -rf $TEMP_FOLDER |