Skip to content

Instantly share code, notes, and snippets.

@marcoarruda
Created November 1, 2022 15:14
Show Gist options
  • Save marcoarruda/0fa7e7a8528739ea104dc4b64c3e4071 to your computer and use it in GitHub Desktop.
Save marcoarruda/0fa7e7a8528739ea104dc4b64c3e4071 to your computer and use it in GitHub Desktop.
Convert .mov to .gif
#!/bin/bash
export INPUT="${1}"
echo $INPUT
export OUTPUT="${2}"
echo $OUTPUT
if [ ! -f "$INPUT" ]
then
echo "File $INPUT does not exists"
return 1
fi
if [ -f "$OUTPUT" ]
then
echo "File $OUTPUT already exists"
return 1
fi
echo "Start converting $INPUT to ${OUTPUT}.gif ..."
ffmpeg -i "$INPUT" -pix_fmt rgb8 -r 10 "${2}.gif" && gifsicle -O3 "${2}.gif" -p "${2}.gif"
@marcoarruda
Copy link
Author

For MacOS
brew install ffmpeg gifsicle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment