Skip to content

Instantly share code, notes, and snippets.

@kdzwinel
Last active February 11, 2020 22:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save kdzwinel/3990edef9eb21fff795a to your computer and use it in GitHub Desktop.
Save kdzwinel/3990edef9eb21fff795a to your computer and use it in GitHub Desktop.
Making gifs from mov files on OS X.
#!/bin/sh
palette="./palette.png"
# speed - setpts=0.15*PTS,
# crop - ffmpeg -i in.mov -filter:v "crop=480:600:320:80" out.mov
filters="fps=25,scale=640:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $1.gif
@kdzwinel
Copy link
Author

Example output:

DevTools new menu

@kdzwinel
Copy link
Author

@crates
Copy link

crates commented Feb 11, 2020

Where can one source palette.png? What does that file look like?

@kdzwinel
Copy link
Author

@crates it's generated in line 10 and used in line 11. You don't need to have it.

@crates
Copy link

crates commented Feb 11, 2020

Awesome... thanks dude! I really enjoyed looking over your public gists today.
Thanks for sharing so much great stuff. You are clearly a skilled developer!

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