Created
April 28, 2021 15:16
-
-
Save thetwopct/ccc0f985bc7f4721d7557a916ce82145 to your computer and use it in GitHub Desktop.
Convert animated GIFs to lightweight MP4 videos
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
# navigate to folder with gifs in it, then run this at CLI | |
# qulity is controlled by -b:v - lower the number the worse the quality | |
for i in *.gif; | |
do name=`echo "$i" | cut -d'.' -f1` | |
echo "$name" | |
ffmpeg -i "$i" -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 250K "${name}.mp4" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment