Skip to content

Instantly share code, notes, and snippets.

@dswwsd
Last active August 9, 2022 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dswwsd/3a794daecceae6009159bcdf5fb6579d to your computer and use it in GitHub Desktop.
Save dswwsd/3a794daecceae6009159bcdf5fb6579d to your computer and use it in GitHub Desktop.
mov to gif function
mov2gif () {
movie=$1
height=$(mdls -name kMDItemPixelHeight ${movie} | grep -o '[0-9]\+')
width=$(mdls -name kMDItemPixelWidth ${movie} | grep -o '[0-9]\+')
dimensions="${width}x${height}"
ffmpeg -i ${movie} -s ${dimensions} -pix_fmt rgb24 -r 10 -f gif ${movie}.gif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment