Skip to content

Instantly share code, notes, and snippets.

@ptheofan
Created August 5, 2019 07:35
Show Gist options
  • Save ptheofan/93334c4da9d086f850b2c1fae641644b to your computer and use it in GitHub Desktop.
Save ptheofan/93334c4da9d086f850b2c1fae641644b to your computer and use it in GitHub Desktop.
Batch (parallel) Process mp3 files in a folder with #1 ffmpeg (rebuild mp3), mp3gain (normalize), lame (set to cbr)
```bash
# Rebuild mp3 file
find . -name '*.mp3' | parallel 'ffmpeg -y -i {} -c:a libmp3lame -b:a 128k {.}.temp.mp3 && mv {.}.temp.mp3 {}'
# normalize
find . -name '*.mp3' | parallel 'mp3gain -a -k {}'
# cbr (or find the equivalent flags for ffmpeg and do it in one step)
find . -name '*.mp3' | parallel 'lame -m j -b 128 --cbr -q 0 {} {.}.temp.mp3 && mv {.}.temp.mp3 {}'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment