add better gif creating script

this worked well with the “2hr youtube clone” demo
This commit is contained in:
Artur Paikin 2019-01-14 18:16:37 +03:00
parent 030ab82842
commit da5fcced8d

9
bin/to-gif-hq.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
# Convert a video file to a gif.
# `to-gif /path/to/input.mp4 /path/to/output.gif`
palette="/tmp/to-gif-palette.png"
filters="fps=15"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
# gifsicle --resize-fit-width 1000 -i animation.gif > animation-1000px.gif