Skip to content

Instantly share code, notes, and snippets.

@riebschlager
Last active September 27, 2018 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riebschlager/89fa399d034723200321 to your computer and use it in GitHub Desktop.
Save riebschlager/89fa399d034723200321 to your computer and use it in GitHub Desktop.
FFMpeg Snippets
# Image series to video
ffmpeg -y -i %05d.tif -b:v 10M -vcodec mpeg4 video.mov
# Movie to GIF
ffmpeg -i input.mov -r 10 -pix_fmt rgb24 -vf scale=500:500 output.gif
# Webm Encoding
ffmpeg -i IN.mp4 -codec:v libvpx -quality good -cpu-used 0 -b:v 15M -qmin 10 -qmax 42 -threads 4 -codec:a libvorbis OUT.webm
# Webm Encode a all MP4s
find . -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -codec:v libvpx -quality good -cpu-used 0 -b:v 15M -qmin 10 -qmax 42 -threads 4 -codec:a libvorbis "${0%%.mov}.webm"' {} \;
# Transparent Video
ffmpeg -y -i %05d.png -b:v 10M -vcodec qtrle video.mov
ffmpeg -i test.mov -c:v libvpx-vp9 -pix_fmt yuva420p -strict -2 out.webm
# Misc
ffmpeg -i "HA to HE_%04d.png" -c:v libvpx-vp9 -b:v 20M -pix_fmt yuva420p -strict -2 ha-to-hc.webm
ffmpeg -i "HC to HT_%04d.png" -c:v libvpx-vp9 -b:v 20M -pix_fmt yuva420p -strict -2 hc-to-ht.webm
ffmpeg -i "HE to HC_%04d.png" -c:v libvpx-vp9 -b:v 20M -pix_fmt yuva420p -strict -2 he-to-hc.webm
ffmpeg -i "HT to HC_%04d.png" -c:v libvpx-vp9 -b:v 20M -pix_fmt yuva420p -strict -2 ht-to-hc.webm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment