Skip to content

Instantly share code, notes, and snippets.

@thisislawatts
Created October 24, 2014 11:44
Show Gist options
  • Save thisislawatts/8a1356b7528a5556eb7c to your computer and use it in GitHub Desktop.
Save thisislawatts/8a1356b7528a5556eb7c to your computer and use it in GitHub Desktop.
Convert your gif to an mp4
function giftomp4() {
file_path=$(pwd)
file_name=$(basename "${1}")
file_ext="${file_name##*.}"
file_name="${file_name%.*}"
frame_rate=3
if [ "$2" ]
then
frame_rate=${2}
fi
echo "$file_name.$file_ext"
ffmpeg -f gif -r $frame_rate -i $file_name.$file_ext -vcodec libx264 -pix_fmt yuv420p $file_name.mp4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment