Skip to content

Instantly share code, notes, and snippets.

@ziyunli
ziyunli / ff.sh
Last active March 31, 2016 19:36
ffmpeg cheatsheet
# use reinstall if ffmpeg has already been installed via homebrew
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265
# export the movie to frames using ffmpeg then make the GIF with convert from ImageMagick
# from http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality#
mkdir frames
ffmpeg -i input -vf scale=320:-1:flags=lanczos,fps=10 frames/ffout%03d.png # export frames
convert -loop 0 frames/ffout*.png output.gif
# Add an empty audio track to video