Skip to content

Instantly share code, notes, and snippets.

Embed
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"
done
@jonnymaceachern

This comment has been minimized.

Copy link
Owner Author

jonnymaceachern commented Aug 28, 2019

Usage

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

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.