Permalink
Browse files

gifify from @slexaxton. recommended with --good option.

  • Loading branch information...
paulirish committed Mar 5, 2013
1 parent 1cdf80b commit 60f9d4a6d169135718583943e90e74a8740a4dc8
Showing with 18 additions and 0 deletions.
  1. +18 −0 .functions
View
@@ -124,3 +124,21 @@ function extract() {
echo "'$1' is not a valid file"
fi
}
+
+
+# animated gifs from any video
+# from alex sexton gist.github.com/SlexAxton/4989674
+gifify() {
+ if [[ -n "$1" ]]; then
+ if [[ $2 == '--good' ]]; then
+ ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
+ time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
+ rm out-static*.png
+ else
+ ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
+ fi
+ else
+ echo "proper usage: gifify <input_movie.mov>. You DO need to include extension."
+ fi
+}
+

0 comments on commit 60f9d4a

Please sign in to comment.