Created
June 18, 2026 15:26
-
-
Save bmorris3/6b1a7e0a3ccada6ce7ea4e42fb7efff5 to your computer and use it in GitHub Desktop.
Convert Mac QuickTime screen recordings to small-ish GIFs for readmes/docs
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 | |
| # Convert a quicktime screen recording to a small-ish gif | |
| # | |
| # call signature: | |
| # ./mov_to_gif.sh <filename>.mov | |
| # | |
| # output will be saved to <filename>.gif | |
| input_file=$1 | |
| input_file_strip_extension=$(echo "$input_file" | cut -d '.' -f 1) | |
| output_file="$input_file_strip_extension.gif" | |
| ffmpeg -i "$input_file" -vf "fps=8,scale=1200:-1:flags=lanczos,split[a][b];[a]palettegen=max_colors=256[p];[b][p]paletteuse=dither=floyd_steinberg" -f gif - | gifsicle -j -O3 --delay=5 > "$output_file" | |
| echo "Done: '$input_file' converted to '$output_file'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment