Linux MP3 – Join Multiple MP3 Files Losslessly

debianlinuxmp3Ubuntu

How do you join multiple MP3 files into one? "cat" and "mp3wrap" are no good as they produce non standard MP3 files. I know I can use audacity, but when you have 1000's of MP3 files to join into one, it takes too long.

Any suggestions?

Best Answer

Use ffmpeg or a similar tool to convert all of your MP3s into a consistent format, e.g.

ffmpeg -i originalA.mp3 -f mp3 -ab 128kb -ar 44100 -ac 2 intermediateA.mp3 ffmpeg -i originalB.mp3 -f mp3 -ab 128kb -ar 44100 -ac 2 intermediateB.mp3

Then, at runtime, concat your files together:

cat intermediateA.mp3 intermediateB.mp3 > output.mp3

Finally, run them through the tool MP3Val to fix any stream errors without forcing a full re-encode:

mp3val output.mp3 -f -nb
(source)