[zsh] Add function to convert mp4 to gif (from howto file)
This commit is contained in:
parent
17492a7559
commit
776a83d71c
1 changed files with 9 additions and 0 deletions
|
@ -97,4 +97,13 @@ ssh_kitty () {
|
||||||
kitty +kitten ssh "$@"
|
kitty +kitten ssh "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mp4togif() {
|
||||||
|
if [ "$1" = "-h" ] || [ "$#" -ne "2" ]; then
|
||||||
|
>&2 echo "Usage: $0 <input.mp4> <output.gif>"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ffmpeg -i "$1" -vf "fps=10,scale=320:-1:flags=lanczos,split[x][z];[z]palettegen[y];[x][y]paletteuse" -loop 0 "$2"
|
||||||
|
}
|
||||||
|
|
||||||
# vim: ft=zsh
|
# vim: ft=zsh
|
||||||
|
|
Loading…
Reference in a new issue