Batch convert WEBM to MP3

WebM is an open, royalty-free, file container structure that can hold audio and video formats. Its audio streams are compressed with the Vorbis or Opus audio codecs. In this article I’ll explain how you can easily convert WEBM audio files to MP3 files from the terminal window.

Open a Terminal window and go to the folder that is holding your WEBM audio files. Now copy and paste the following command:

for f in *.webm; do ffmpeg -i “$f” -ab 320k “${f%.webm}.mp3”; done

For example:
$ cd Audio/Wanderen/Ready4Conversion
$ for f in *.webm; do ffmpeg -i “$f” -ab 320k “${f%.webm}.mp3”; done

The example above converts all WEBM audio files in the folder “Audio/Wanderen/Ready4Conversion” to MP3 files.

Suggestions for improving this article are welcome, please let me know and drop me a line .