Created
September 30, 2022 15:39
-
-
Save Cobesz/e101fc653f1ea3405f0290ebe645d24e to your computer and use it in GitHub Desktop.
Gnome screenshot tool allows you to record screencasts in webm format. For some usecases (documentation for example) I want to convert this screencast to a gif format so I can easily place it inside other documents. (Markdown files for example as they don't support webm yet).
This file contains 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 | |
INPUT="$1" | |
OUTPUT="$(basename "${INPUT%.*}")" | |
ffmpeg -i "${INPUT}" \ | |
-vf "fps=10,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \ | |
-loop -1 \ | |
"${OUTPUT}.gif" | |
gifsicle --optimize=3 --output "${OUTPUT}-optimized.gif" --resize-height 600 "${OUTPUT}.gif" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment