Skip to content

Instantly share code, notes, and snippets.

@abdus
Last active December 9, 2018 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdus/754971f2ee93f414ed3c30db989e329d to your computer and use it in GitHub Desktop.
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
#!/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