Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 5988  / 2 Years ago, sun, september 25, 2022, 2:25:05

I'm looking for a tool for Ubuntu 13.04 that can reduce the bitrate of multiple mp3 files. Does anyone happen to know such a tool?


More From » 13.04

 Answers
6

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

[#29723] Monday, September 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fectlyole

Total Points: 64
Total Questions: 110
Total Answers: 110

Location: Nicaragua
Member since Thu, Feb 3, 2022
2 Years ago
fectlyole questions
Sun, May 8, 22, 02:54, 2 Years ago
Mon, Jun 21, 21, 16:56, 3 Years ago
Fri, Jul 9, 21, 17:44, 3 Years ago
;