Created
November 1, 2022 15:14
-
-
Save marcoarruda/0fa7e7a8528739ea104dc4b64c3e4071 to your computer and use it in GitHub Desktop.
Convert .mov to .gif
This file contains hidden or 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 | |
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For MacOS
brew install ffmpeg gifsicle