Last active
August 13, 2021 15:19
-
-
Save displaynone/c906780db2bb34117290f6d2beb11936 to your computer and use it in GitHub Desktop.
Convert video to GIF
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
$ more /usr/local/bin/video2gif.sh | |
#!/bin/bash | |
# https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/ | |
echo "Video file: " | |
read video_file | |
echo "Video start position (HH:MM:SS): " | |
read start_seek | |
echo "GIF duration (ss.sss): " | |
read duration | |
echo "GIF name: " | |
read output_file | |
ffmpeg -ss $start_seek -t $duration -i $video_file -filter_complex "[0:v] fps=12,scale=w=480:h=-1,split [a][b];[a] palettegen=[p];[b][p] palet | |
teuse=new=1" $output_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment