Created
November 22, 2017 08:50
-
-
Save wopian/f6caec6d0ab4cdde0a828a1cb430d56c to your computer and use it in GitHub Desktop.
GIF to Webm
This file contains hidden or 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
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