Skip to content

Instantly share code, notes, and snippets.

if [[ $1 == "-h" ]] || [ $# == 0 ]; then
echo "Convert video to GIF"
echo "Usage:"
echo " video2gif <file-name> [width] [fps]"
else
ffmpeg -y -i "${1}" -vf fps=${3:-10},scale=${2:-320}:-1:flags=lanczos,palettegen "${1}.png"
ffmpeg -i "${1}" -i "${1}.png" -filter_complex "fps=${3:-10},scale=${2:-320}:-1:flags=lanczos[x];[x][1:v]paletteuse" "${1}".gif
rm "${1}.png"
fi
@huytd
huytd / wordle.md
Last active May 2, 2024 12:13
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode: