Created
August 31, 2012 14:06
-
-
Save LukasReschke/3553101 to your computer and use it in GitHub Desktop.
Converts all mp3 files in a directory to 128kbit/s if necessary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Requirements: ffmpeg, mp3info | |
| # Do a "mkdir output" before execution | |
| for f in *.mp3; do | |
| if [ "$(mp3info -r m -p %r "$f")" -ge 128 ]; then | |
| ffmpeg -y -i "$f" -ab 128k "output/${f%.mp3}.mp3" | |
| else | |
| cp "$f" "output/$f" | |
| fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment