Skip to content

Instantly share code, notes, and snippets.

@karltaylor
Last active June 19, 2018 20:26
Show Gist options
  • Save karltaylor/240b750a18149e981e2d90efc720aeda to your computer and use it in GitHub Desktop.
Save karltaylor/240b750a18149e981e2d90efc720aeda to your computer and use it in GitHub Desktop.
Bash script to scale, convert and compress videos within a directory to .webm
for file in *.mp4; do ffmpeg -i "$file" -filter:v scale=1080:-1 -acodec libvorbis -ac 2 -b:v 5000k "${file%.mp4}".webm; done
@karltaylor
Copy link
Author

karltaylor commented May 25, 2016

install ffmpeg with the relevant codecs using homebrew

$ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265

@karltaylor
Copy link
Author

ffmpeg -i input.mp4 -filter:v scale=1080:-1 -acodec libvorbis -ac 2 -b:v 5000k output.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment