Reducing multiple mp3 bitrate
Reducing the bit rate will involve re-encoding, which means that you'll have to create separate output files. You could use avconv
from the command-line:
avconv -i input.mp3 -c:a libmp3lame -b:a 128k output.mp3
To do a whole directory of .mp3s:
for f in ./*.mp3; do avconv -i "$f" -c:a libmp3lame -b:a 128k "${f%.*}-out.mp3"; done
This will create files with -out.mp3
at the end of their names. If you want to replace your originals, you can then use mv
to overwrite them (warning: this should be considered irreversible):
for f in ./*.mp3; do avconv -i "$f" -c:a libmp3lame -b:a 128k "${f%.*}-out.mp3" && mv "${f%.*}-out.mp3" "$f"; done
It might be safer to do this in two steps:
for f in ./*.mp3; do avconv -i "$f" -c:a libmp3lame -b:a 128k "${f%.*}-out.mp3"; done
for f in ./*-out.mp3; do mv "$f" "${f%-out.mp3}.mp3"; done
You can do this to files recursively (every .mp3 in the working directory and all sub-directories):
shopt -s globstar
for f in ./**/*.mp3; do avconv -i "$f" -c:a libmp3lame -b:a 128k "${f%.*}-out.mp3"; done
for f in ./**/*-out.mp3; do mv "$f" "${f%-out.mp3}.mp3"; done
ffmpeg
is the tool I'd use, and I'd combine it with find
to find the files I wanted converting.
mkdir converted
find . -iname '*.mp3' -exec ffmpeg -i "{}" -b 100k "{}" "converted/{}" \;