Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I decode and re-encode MP3 file with the same settings, should it be similar to the original?

Re-encoding may be useful when dealing with damaged mp3 files. When I just play them (with mp3lib) it produce shock-in-headphones clicks and bloops, but decoding them with lame --decode produces better sound (silent bloops).

So I've just ran lame --decode rhapsody.mp3 - | lame -b 64 -h - rhapsody.recode.mp3. Is it a good way of dealing with broken mp3s?

P.S. just curious: If I decode/encode the the again and again to what will it converge (if it converges)?

share|improve this question
up vote 2 down vote accepted

Decoding and re-encoding and MP3 file is like opening a JPG image and then resaving it as another JPG.

MP3 like JPG is a lossy compression format, so you will loose information each time you re-encode it.

However, the effects can be minimised by saving with the least amount of compression - you throw less of the file away.

So in your case you should be OK with the one iteration.

However, if you persist you will end up with more and more artefacts and potentially, if you keep it up long enough, just a smear of sound.

share|improve this answer
(Experimenting with decode-encode loop to find out that) – Vi. Sep 11 '10 at 15:54
If you round a number, if will lose some information. But it you round it again and again it will not lose more information. – Vi. Sep 11 '10 at 16:07
After 57 decode-encode iterations the music has become very bad. Like if it were very low bitrate. – Vi. Sep 11 '10 at 16:13
@Vi - the number rounding analogy is a good one - mind if I use it elsewhere? – ChrisF Sep 11 '10 at 16:28
@ChrisF, No objections to use the analogy for other things. /* Why are you asking BTW? Isn't it obvious? */ – Vi. Sep 11 '10 at 16:54

You must log in to answer this question.

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