Created
January 31, 2019 09:53
-
-
Save zinozzino/a119ed1e89a558875151a3167878a959 to your computer and use it in GitHub Desktop.
mov to gif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Original Gist: https://gist.github.com/baumandm/1dba6a055356d183bbf7 | |
# Requirements: | |
# ffmpeg ( install via `brew install ffmpeg` ) | |
SOURCE=$1 | |
DEST=${SOURCE%%.*} | |
PALETTE="$(python -c "import uuid; print(uuid.uuid4().hex, end='')").png" | |
if [ "${SOURCEi##*.}" -ne "mov" ]; then | |
echo "It supports only .mov file..." | |
exit 1 | |
fi | |
ffmpeg -y -i "$SOURCE" -vf fps=10,palettegen "$PALETTE" | |
ffmpeg -i "$SOURCE" -i "$PALETTE" -filter_complex "fps=10,paletteuse" "$DEST.gif" | |
rm "$PALETTE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment