Skip to content

Instantly share code, notes, and snippets.

@wopian
Created November 22, 2017 08:50
Show Gist options
  • Save wopian/f6caec6d0ab4cdde0a828a1cb430d56c to your computer and use it in GitHub Desktop.
Save wopian/f6caec6d0ab4cdde0a828a1cb430d56c to your computer and use it in GitHub Desktop.
GIF to Webm
if shopt -q globstar
then
IFS=$'\n'
for file in $(find -name '*.gif')
do
printf "%16s Converting to webm >> $file\n" $SECONDS &&
ffmpeg -loglevel panic -i "$file" -c:v libvpx -crf 10 -an -b:v 10M -y "${file%.gif}.webm" &&
if [ -f "${file%.gif}.webm" ]
then
printf "%16s Deleting gif >> $file\n" $SECONDS
rm "$file"
fi
done
else
echo "Enable globstar: shopt -s globstar"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment