Skip to content

Instantly share code, notes, and snippets.

@jonathanconway
Last active July 18, 2024 04:25
Show Gist options
  • Save jonathanconway/e8aedf6d1a3b9029595df4a7d9877323 to your computer and use it in GitHub Desktop.
Save jonathanconway/e8aedf6d1a3b9029595df4a7d9877323 to your computer and use it in GitHub Desktop.
Convert QuickTime screencasts to animated GIFs using ffmpeg
#!/bin/bash
# Inspired by solution by StackOverflow user #18664.
# [See: https://apple.stackexchange.com/a/211219/97498]
#
# Dependencies: ffmpeg, gifsicle
#
# Usage:
# mov2gif [filename]
#
# filename - name of a .mov file to convert
#
# Outputs a file with the same name, suffixed with ".gif"
ffmpeg -i "$@" -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=7 > "$@".gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment