Skip to content

Instantly share code, notes, and snippets.

Created August 28, 2019 14:59
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Batch convert mp4 to webm using ffmpeg
for i in *.mp4;
do name=`echo "$i" | cut -d'.' -f1`
echo "$name"
ffmpeg -i "$i" -acodec libvorbis -aq 5 -ac 2 -qmax 25 -threads 2 "${name}.webm"
Copy link

jonnymaceachern commented Aug 28, 2019


  1. Install ffmpeg
  2. Download (Link)
  3. Move script to any directory that's part of your environment $PATH (e.g. ~/bin)
  4. Make the script executable (chmod +x
  5. cd to the directory with the mp4 files
  6. Run command with no arguments (

Note: ffmpeg must be available in your environment $PATH.

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