4

I can save space by reducing bitrates of songs to x*, the value beyond which humans don't discern any difference. If so, how to reduce the bitrates with CLI:

 1. mp3 to mp3 conversion
 2. during mp3 to ogg conversion
 3. ogg to ogg conversion

Of course, if the original bitrate is inferior than this "x", I don't want to artificially increase, I dare say.

* Reference to other question: What is the maximum audio bitrate humans can distinguish?

1
  • Are you aware of the difference between (1) quality loss due to lower bitrate, and (2) quality loss due to reenconding transcoding? The difference is great and the quality loss of the latter is distinguishable for listerners even if the bitrate is kept constant.
    – N.N.
    Aug 31, 2011 at 10:54

2 Answers 2

9

Do not do this. Transcoding from a lossy format to another lossy format will only decrease quality. You won't save any meaningful space. No matter if it is from mp3 to mp3, ogg to ogg or mp3 to ogg. You will lose quality. They are called lossy formats for a reason.

Do the test yourself: convert the same song 5 (or 10) times from 128 to 128. Yes, same bitrate. Quality will be inferior than original file. Every conversion introduces artifacts that will lower the perceived quality. A file that was transcoded from 320 to 256 than to 160 will sound worse than if encoded directly from source to 160

If you really want to save space, get your original, un-encoded, lossless files, and convert them once to your desired bitrate. My strong suggestion? Go VBR. lame's -V5 for casual listening (average ~130, much higher quality than any other 160 or 192 CBR), or -V3 if you're very picky about quality.

Do not use CBR if you're trying to save space. Its a dumb format: why keep a constant, say, 160 kpbs if some passages of the song would require much less than that to achieve "perceived perfection"? Those "wasted" bits could be used more efficiently in other passages where complexity (lots of instruments, multiple (and high) frequencies, etc) would require more bits.

VBR can do that. Goes up all the way to 320 when that is needed, to keep quality, and reduce down to 96 (or less) to save space when it doesnt require many bits for same perceived quality.

In other words: VBR's are both more economical (saves when not needed) and higher quality (increases when needeed). A wise choice if you want a good balance between less disk space and great quality.

4
  • I couldn't find -V5 or -V3 in my ffmpeg help. How can I do it? Actually, since mp3 to ogg is bad idea, I started another question here: askubuntu.com/questions/59520/… Sep 1, 2011 at 5:26
  • strapakowsky: -V3 and -V5 are options to lame, considered by many (including me) THE best MP3 encoder, specially for VBR
    – MestreLion
    Sep 1, 2011 at 5:30
  • Of course the downside to VBR is higher cpu (therefore, power) usage. Keep this in mind if you're listening on mobile and care about your battery life.
    – lamino
    Mar 10, 2019 at 0:19
  • @lamino: VBR might be more CPU intensive when encoding (ie, recording), but for decoding (ie, listening/playing) I could not find any citation saying it could cause any significant or even noticeable CPU/Battery drain.
    – MestreLion
    Mar 10, 2019 at 12:25
7

To do this you could use ffmpeg with libavcodec-extra-52.

cd to the directory of the file, then:

ffmpeg -i input.file.mp3 -ab 64 -f ogg output.ogg  

or

ffmpeg -i input.file.mp3 -ab 64 -f mp3 output.mp3  

The number after -ab is the bitrate. If you want to use VBR then replace -ab for -aq.

Be aware of MestreLion advice.

3
  • Can ffmpeg encode to VBR instead of a constant bitrate? If so, please at least suggest that instead of -b. It will save more space and have better quality, minimizing the quality loss impact of the transcoding
    – MestreLion
    Aug 31, 2011 at 19:58
  • Great idea. I've updated the answer.
    – desgua
    Aug 31, 2011 at 20:03
  • 1
    As of six years from that posting, the new bitrate needs to be set in "k", it seems: ffmpeg -i input.file.mp3 -ab 64k -f mp3 output.mp3
    – Dɑvïd
    May 15, 2017 at 14:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .