Skip to content

Instantly share code, notes, and snippets.

@caiguanhao
Last active December 6, 2021 11:00
Show Gist options
  • Save caiguanhao/b32bc005b172de8f98daed15a39be233 to your computer and use it in GitHub Desktop.
Save caiguanhao/b32bc005b172de8f98daed15a39be233 to your computer and use it in GitHub Desktop.
ffmpeg parallel batch/bulk convert opus to mp3 with meta data
# install parallel if you don't have one
brew install parallel

chmod +x convert.sh
./convert.sh

# delete opus files
find . -type f -name '*.opus' -delete
#!/bin/bash
my_func() {
file=$1
ffmpeg -i "$file" -map_metadata 0:s:a:0 "${file%.opus}.mp3" >/dev/null 2>&1
}
export -f my_func
find . -type f -name '*.opus' -print0 | parallel -j 8 -0 my_func {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment