Skip to content

Instantly share code, notes, and snippets.

@miketahani
Last active March 30, 2021 06:58
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 miketahani/64de1fc371f91995451d8f6fe1c5d3a5 to your computer and use it in GitHub Desktop.
Save miketahani/64de1fc371f91995451d8f6fe1c5d3a5 to your computer and use it in GitHub Desktop.

convert mp4 to gif

$ ffmpeg -ss 61.0 -t 2.5 -i input.mp4 -filter_complex "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse" output.gif

  • -ss 61.0: start gif at 61.0 seconds into video
  • -t 2.5: gif duration of 2.5 seconds (starting at 61.0 seconds into video)

crop existing gif

convert input.gif -coalesce -repage 0x0 -crop 343x310+0+65 +repage output.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment