Convert Movie or Animation to Animated Gif

mkdir frames
ffmpeg -i input -vf scale=320:-1:flags=lanczos,fps=10 frames/ffout%03d.png

convert -loop 0 frames/ffout*.png -fuzz 20% -layers OptimizePlus output.gif

Thanks to: http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality