Skip to content

Instantly share code, notes, and snippets.

@Frogli
Last active February 28, 2020 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frogli/da56d97a4677c54b2961030d1f24eb3c to your computer and use it in GitHub Desktop.
Save Frogli/da56d97a4677c54b2961030d1f24eb3c to your computer and use it in GitHub Desktop.
Utility script to convert mov files to gif
#!/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