Skip to content

Commit

Permalink
gif function for converting a mov to gif
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKnarf committed Jun 20, 2024
1 parent 3e877a6 commit 3dd9bad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ function mat {
man $tempfile
}

gif() {
# Based on https://gist.github.com/SheldonWangRJT/8d3f44a35c8d1386a396b9b49b43c385
output_file="${1%.*}.gif"
ffmpeg -y -i "$1" -v quiet -vf scale=iw/2:ih/2 -pix_fmt rgb8 -r 10 "$output_file" && gifsicle -O3 "$output_file" -o "$output_file"
}

# Setup path
path+=(
'/usr/bin'
Expand Down

0 comments on commit 3dd9bad

Please sign in to comment.