Help - Search - Members - Calendar
Full Version: Help! Clipping after MP3 encoding
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
Weps
I thought I was pretty safe while using Exact Audio Copy and LAME, but now I noticed a lot of my MP3's are clipping (MP3Gain says they are clipping after analazing the files, and I saw it with my own eyes by opening them in Sound Forge).

This is how I work:

I rip the CD with Exact Audio Copy (Secure mode). No normalization or whatever, I just rip the CD, because I want an EXACT copy. I opened the .wav files in Sound Forge and there is no clipping. The files are just perfect.

Then I encode the .wav files to MP3 by using LAME (with the Razorlame front end). I use these settings: -b 256 -m s -h.

Now, while the .wav files were perfect (no clipping), the MP3's are bad. Most of them clip, not much (in Sound Forge, most of the times it's 0,0) but they do. Why is that? I thought LAME only did the MP3 encoding. Why is it also messing with the volume?

I also tried to skip the Razorlame part and let Exact Audio Copy do the MP3 encoding (with the same settings for the LAME encoder), but the result was the same.

I'm pretty dissapointed now. Is there anything I might be doing wrong? I mean, I was convinced the Exact Audio Copy / LAME combination was the only right one if you prefer quality, but now I started doubting... sad.gif
kjoonlee
It's because you're using -b256 -m s -h. Use -V2 instead.

Just kidding.

Seriously though, MP3 encoding usually involves converting integer samples into floating point values, and clipping is inevitable if the source was close to clipping.

There's nothing wrong with LAME, and you can't avoid that kind of clipping at encode-time; if anything's wrong, it's your CDs that are too loud. Meanwhile, you can get rid of that sort of clipping by reducing the volume of the files with MP3Gain, so you have nothing to worry about.

---

Why don't you use --preset cbr 256 or something similar, instead of -b 256 -m s -h which might not be as good?
Weps
QUOTE(kjoonlee @ Oct 20 2005, 01:48 AM)
It's because you're using -b256 -m s -h. Use -V2 instead.

Just kidding.

Seriously though, MP3 encoding usually involves converting integer samples into floating point values, and clipping is inevitable if the source was close to clipping.

OK, thanks for your response. That's one illusion less for me. dry.gif

QUOTE(kjoonlee @ Oct 20 2005, 01:48 AM)
There's nothing wrong with LAME, and you can't avoid that kind of clipping at encode-time; if anything's wrong, it's your CDs that are too loud. Meanwhile, you can get rid of that sort of clipping by reducing the volume of the files with MP3Gain, so you have nothing to worry about.


Hm... yeah, but my 'illusion' was to have exact the same files as on the CD, only not that big. Yes, I understand MP3 is lossy, but with 'exact' I mean the same length, the same volume, etc.
---

QUOTE(kjoonlee @ Oct 20 2005, 01:48 AM)
Why don't you use --preset cbr 256 or something similar, instead of -b 256 -m s -h which might not be as good?
*



Those are extra flags, added by Razorlame when I chose for optimalisation: qualite (which gives -h), stereo (s) and the -m, well... I have no idea where that is coming from.

I'm not really experienced with this command line thing, but I will try your --preset cbr 256 directly in Exact Audio Copy.
Weps
Hm... but I don't get it straight. In some MP3 files I hear tics because of the clipping, while those tics aren't there in the original .wav files (as there is no clipping in the .wav files). So this is all normal and I should use MP3Gain by default on each song? blink.gif
Weps
OK, now I'm becoming crazy... The tics I hear in Sound Forge, I don't hear in iTunes and the tics I notice in iTunes, I don't hear in Sound Forge, although it's the same MP3 file. And when I decrease the volume bar in iTunes (less than 100%), some tics dissapear. I think I need some rest. Will take another look in it, tomorrow, with some fresh thoughts. smile.gif
Danimal
QUOTE(Weps @ Oct 19 2005, 08:25 PM)
Hm... but I don't get it straight.  In some MP3 files I hear tics because of the clipping, while those tics aren't there in the original .wav files (as there is no clipping in the .wav files).  So this is all normal and I should use MP3Gain by default on each song?  blink.gif
*



Yes. There are two kinds of clipping. One is in the original source CD, which results from bad mastering, and there's nothing you can do about it. The other, as described above, results from the mp3 encoding process. You can use mp3gain to lower the volume to the point where there is no clipping. If you use album mode, it will modify all of the songs in the album so that their loudness relative to each other will be preserved.
kjoonlee
One other thing to make you feel better: using mp3gain to lower the volume is just like using your volume knob to lower volume while listening to pristine rips from CDs.
Drenholm
Also, the -ms switch does not guarantee higher quality! This has been said many times on HA from what I have seen. Joint stereo has the capability to be more efficient and allow higher quality for similar file sizes.
Weps
OK, so I'm new in this whole preset thing. Now I was trying the -V 0 --vbr-new preset. But what I don't get: people recommend presets over here, but they don't recommend a minimal bitrate, when using VBR. In Exact Audio Copy, I still have to enter a minimal bitrate. Which should I use?
gasmann
QUOTE(Weps @ Oct 20 2005, 08:16 PM)
But what I don't get: people recommend presets over here, but they don't recommend a minimal bitrate, when using VBR.  In Exact Audio Copy, I still have to enter a minimal bitrate.  Which should I use?
*



None. You should follow the instructions in this thread to setup EAC with LAME properly. There's also a lot of info about LAME in general there, and it's best switches.
Weps
QUOTE(gasmann @ Oct 20 2005, 07:48 PM)
None. You should follow the instructions in this thread to setup EAC with LAME properly. There's also a lot of info about LAME in general there, and it's best switches.
*


Well, actually I did. sad.gif

In the Compression options, on the tab External compression, you can enter the command line. So I've putted -V 0 --vbr-new over there. Below that, you'll find a pulldown menu where you can chose a bitrate. I don't see an option to disable this, so I'll have to chose a bitrate. I noticed that when I chose 192 kbps, I have much bigger files than when I chose 96 kbps... So it seems to me this is the minimal bitrate being used, no? blink.gif
dreamliner77
If you set up EAC to use "User Defined Encoder," it only uses the commands in the commandline box.
Weps
QUOTE(dreamliner77 @ Oct 20 2005, 07:58 PM)
If you set up EAC to use "User Defined Encoder," it only uses the commands in the commandline box.
*


Oh, I see... thanks!

There's one little problem left. When using -V 0 --vbr-new, EAC says LAME replied an unknown error while trying to encode the file. The problem is solved when I use -V 0 --vbr-new --add-id3v2 --pad-id3v2 --ta "%a" --tt "%t" --tl "%g" --ty "%y" --tn "%n" %s %d. In fact, I don't need the ID tags, so that's why I tried -V 0 --vbr-new first. Any suggestions?
Lyx
QUOTE(Weps @ Oct 20 2005, 03:13 AM)
Hm... yeah, but my 'illusion' was to have exact the same files as on the CD, only not that big.  Yes, I understand MP3 is lossy, but with 'exact' I mean the same length, the same volume, etc.
*


You mix up "how the waveform looks" and "how it sounds like". Lossy means that it tries to sound the same, not look the same. Obviously, in this case the "look" also causes it to sound different. At this point, a clarification may be in order: the waveform does NOT clip during the encoding process.... an mp3 can store higher volume without "clipping" than the source material..... so, the signal will just go *above* 0db..... but when it is DECODED(playback) then the 0db limit kicks in and it clips. Thus, the audiodata in the mp3 itself is not damaged and does not clip...... it only clips when its decoded at 100% gain. Blame the record labels for producing overly loud CDs which ride the limit so constantly that you can do almost no lossy manipulation without going above 0db.

As others mentioned already, the solution is to use mp3gain or replaygain.
dreamliner77
QUOTE(Weps @ Oct 20 2005, 03:35 PM)
QUOTE(dreamliner77 @ Oct 20 2005, 07:58 PM)
If you set up EAC to use "User Defined Encoder," it only uses the commands in the commandline box.
*


Oh, I see... thanks!

There's one little problem left. When using -V 0 --vbr-new, EAC says LAME replied an unknown error while trying to encode the file. The problem is solved when I use -V 0 --vbr-new --add-id3v2 --pad-id3v2 --ta "%a" --tt "%t" --tl "%g" --ty "%y" --tn "%n" %s %d. In fact, I don't need the ID tags, so that's why I tried -V 0 --vbr-new first. Any suggestions?
*




You need to add "%s %d" to your command line. (-V 0 --vbr-new %s %d)
Weps
QUOTE(dreamliner77 @ Oct 20 2005, 08:53 PM)
You need to add "%s %d" to your command line.  (-V 0 --vbr-new %s %d)
*


I see. Thanks for the information!

Also thanks to all the other people who gave me some useful information in this topic. At least now I know some things about MP3 encoding, I didn't know before. Thanks a lot!

And now I can start ripping my whole CD collection all over again. tongue.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.