Last active
February 28, 2020 08:53
-
-
Save Frogli/da56d97a4677c54b2961030d1f24eb3c to your computer and use it in GitHub Desktop.
Utility script to convert mov files 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
#!/usr/local/bin/bash | |
usage="Converts a .mov file to a gif with. | |
Command: mov2gif.sh [file.mov] [nnnnxnnnn] | |
[file.mov] Input file | |
[nnnnxnnnn] Optioneel. Output resolution" | |
case $1 in | |
-h) | |
echo $usage ;; | |
h) | |
echo $usage ;; | |
help) | |
echo $usage ;; | |
*) | |
output=${1%.*} | |
[ ! -z "$var" ] && resolution="-s ${2}" | |
ffmpeg -i "${1}" ${resolution} -pix_fmt rgb8 -r 10 -f gif - | gifsicle --optimize=3 --delay=5 > "${output}".gif | |
esac | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment