Skip to content

Instantly share code, notes, and snippets.

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"

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.