Skip to content

Instantly share code, notes, and snippets.

@kdzwinel

kdzwinel/mkgif.sh

Last active Feb 11, 2020
Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@kdzwinel kdzwinel commented Jun 15, 2015

Example output:

DevTools new menu

@kdzwinel

This comment has been minimized.

Copy link
Owner Author

@kdzwinel kdzwinel commented Feb 23, 2016

@crates

This comment has been minimized.

Copy link

@crates crates commented Feb 11, 2020

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

@kdzwinel

This comment has been minimized.

Copy link
Owner Author

@kdzwinel kdzwinel commented Feb 11, 2020

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

@crates

This comment has been minimized.

Copy link

@crates 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
You can’t perform that action at this time.