Skip to content

Instantly share code, notes, and snippets.

@ebual
Created January 14, 2021 09:30
Show Gist options
  • Select an option

  • Save ebual/dc0a253007f184e9f322cfa968be0c77 to your computer and use it in GitHub Desktop.

Select an option

Save ebual/dc0a253007f184e9f322cfa968be0c77 to your computer and use it in GitHub Desktop.
Mac Automator script for converting a video file to GIF
#!/bin/bash
originalFilePath=$1
#extension=$(echo "$originalFilePath" | rev | cut -d"." -f1 | rev)
pathWithoutExtension=$(echo "$originalFilePath" | rev | cut -d"." -f2- | rev)
/Applications/ffmpeg -i "$originalFilePath" -filter_complex "[0:v] fps=15,split [a][b];[a] palettegen [p];[b][p] paletteuse" "$pathWithoutExtension.gif"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment