Created
January 7, 2018 08:27
-
-
Save hmnd/1fc1d5fd15f103526e46b28d51ea70e0 to your computer and use it in GitHub Desktop.
Convert gif to mp4 using ffmpeg
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
#!/usr/bin/env bash | |
for f in "$@" | |
do | |
case $(file --mime-type -b "$f") in | |
'image/gif') | |
echo "${f%.*}" | |
ffmpeg -f gif -i "$f" -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' "${f%.*}.mp4";; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment