Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce the size of mp3s in linux? [closed]

Does anyone know of any linux software to reduce the size of mp3 files while having a minimal effect on quality?

I just used pngcrush to do this to all the pngs in our asset library with good results, and would love to be able to do the same to our mp3s. Even if there is a 10% reduction in file size that would be a decent win for me.

Any suggestions? It needs to be something i can call from a shell script.

cheers, max

like image 683
Max Williams Avatar asked Jul 26 '13 15:07

Max Williams


People also ask

How do I compress a large MP3 file?

Go to File > Export and select the format you want to save the file in. Under Format Options, choose the Bitrate Mode (variable or constant), then set a Quality. Hit Save to save a newly compressed file.


2 Answers

You can use lame with the --mp3input option.

For example you can do a downsampling of the mp3 quality, specifing the a new lower bitrate using the -b option. For example if your starting mp3 has a quality of 256kbs you can lower it's bitrate to 128kbs:

lame --mp3input -b 128 input.mp3 output.mp3

Depending from the input file bitrate, the output.mp3 file has lower quality and so a file size reduction.

From the lame manuale page:

--mp3input Assume the input file is a MP3 file. Useful for downsampling from one mp3 to another. As an example, it can be useful for streaming through an IceCast server.

like image 80
Atropo Avatar answered Sep 21 '22 18:09

Atropo


It depends on what you want to achieve. avconv (formerly ffmpeg) is a good tool, but there's no one size fits all solution pertaining the parameters, since it depends heavily on the type of audio data (music, speech, etc) and the original bitrate, etc. Try the different settings, maybe convert it to mono, see what produces still acceptable results for you.

As a general rule of thumb: Speech compresses really well, downsampling it to 11kHz may still give acceptable results, but music can also be downsized by decreasing the bitrate or switching to mono.

like image 22
Janos Pasztor Avatar answered Sep 20 '22 18:09

Janos Pasztor