Last active
December 9, 2018 14:06
-
-
Save abdus/754971f2ee93f414ed3c30db989e329d to your computer and use it in GitHub Desktop.
this script accept a mp4 file path as an arg and convert it to GIF and stores in the same dir
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
#!/bin/bash | |
if [ ! -d ./frames ] | |
then | |
mkdir frames | |
fi | |
ffmpeg -i $1 -r 20 'frames/frame-%03d.jpg' | |
cd frames | |
convert -delay 5 -loop 0 *.jpg $1.gif | |
mv gifImage.gif ../ | |
cd .. | |
rm -rf frames | |
# this script accept a mp4 file path as an arg and convert it to GIF and stores in the same dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment