Kara-Moon Forum
April 20, 2024, 03:59:55 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: The LAME MP3 codec.  (Read 26986 times)
Oren
Moderator
Kara-Moon Master
*****
Posts: 5444


...just looking for clues...


« on: September 22, 2008, 04:44:47 PM »

Looking for the "best" way to represent a quality recording in compressed "lossy" format has been a bit of a project for me over the last couple of years, and after some limited success (and repeated failures, accompanied by depression and feelings of self-doubt Cheesy), here's the situation, as I see it....

Adjusting the source file - applying compression and equalization to provide the most advantageous combination of dynamics and tonal characteristics for your compression codec (Ogg Vorbis or MP3) is critical for best results. In general, lower the bass frequencies, gently boost the frequencies above 10,000 Hz, and compress the file as much as possible without loosing too much dynamic range. The idea is to pack as much useful audio information as possible into your original full-size audio file, while removing those ingredients which don't really contribute to the listening experience in the resulting compressed file.


Ogg Vorbis, by its nature, is variable bit-rate format. By selecting from the various quality settings, you can determine the relative audio quality and resulting file size. The higher quality settings in Ogg Vorbis are commonly perceived by the average listener as indistinguishable from the original audio file. Ogg Vorbis development is ongoing, with updates periodically available from the open-source community.

MP3 as represented by the Fraunhofer codecs, is a reliable, high quality audio compression format. It is generally applied in a "constant bit-rate" method of compression, and is considered the industry standard for MP3 encoding. Quality settings are determined by selecting a bit-rate number; 128kilobits/second being the most common setting. The Fraunhofer codecs are a proprietary format.

MP3 as represented by the LAME codecs, is the open-source version of this audio compression format, and the one I've been working with since adopting Audacity and Ardour/JAMin as my main recording/mixing/mastering tools. Originally developed as an offshoot of current MP3 technologies, it has since been gradually re-written so that none of the original code remains, and thus approaches audio compression in a fundamentally different way than Fraunhofer, while remaining compatible with all recent MP3 players. Unlike Fraunhofer, it is now most advantageously applied as variable bit-rate compression, with a choice of "variable bit-rate" and "average bit-rate" formats, depending on your application. LAME development, like Ogg Vorbis, is ongoing.

My most recent concerns regarding a curious "warbling" effect in Will's(Folderol) "Empires of Dust" was a result of forcing the LAME codec to encode the compressed file in "constant bit-rate" mode. With the recent upgrades to LAME, the constant bit-rate format is optional, and not recommended. Now I know why...

Live and learn... Grin

« Last Edit: September 22, 2008, 05:02:28 PM by Oren » Logged

kara
Kara-Moon, a site built by and for musicians
Global Moderator
Kara-Moon Master
*****
Posts: 4907


Music is my middle name


WWW
« Reply #1 on: September 22, 2008, 05:57:08 PM »

Interest Oren, thanks for posting this.

Can you explain what you mean by "compress the file as much as possible without loosing too much dynamic range"
Do you mean use a compressor as much as possible without loosing dynamics ?

k
Logged

_____oOo______ http://www.myspace.com/kaazduo

www.kara-moon.com, a site built by and for musicians
Support us at : http://www.mymajorcompany.com/Artistes/kaaz/
Wyatt
Kara-Moon-Collective
Kara-Moon Master
**
Posts: 2073



« Reply #2 on: September 22, 2008, 06:03:02 PM »

Adjusting the source file - applying compression and equalization to provide the most advantageous combination of dynamics and tonal characteristics for your compression codec (Ogg Vorbis or MP3) is critical for best results. In general, lower the bass frequencies, gently boost the frequencies above 10,000 Hz, and compress the file as much as possible without loosing too much dynamic range. The idea is to pack as much useful audio information as possible into your original full-size audio file, while removing those ingredients which don't really contribute to the listening experience in the resulting compressed file.

Cool stuff..I never thought of it that way, and I have a good example of a song that mp3 trashes to work with.

Thanks for posting this.

Cool

Wyatt
Logged

folderol
Kara-Moon Master
****
Posts: 5306

Who? Me?


WWW
« Reply #3 on: September 22, 2008, 07:09:23 PM »

You really have got your scholars hat on these days, haven't you Cheesy

This rather explains something. I tried encoding this myself at a bit rate of only 128k (the default for LAME) and didn't seem to get this effect anywhere near so badly. I didn't pursue it (shame on me) but I'm now wondering if LAME also defaults to variable bit rate.
Logged

If you have a poem, I have a tune, and we exchange these, we can both have a poem, a tune, and a song.
- Will
rharv
Use in Moderation
Kara-Moon-Collective
Kara-Moon Master
**
Posts: 1059


Glad to be here


WWW
« Reply #4 on: September 22, 2008, 09:48:48 PM »

It's funny how MP3 can trash a sound from one system, and have a different effect on another.  Oren has put a lot of time into learning these compression schemes; heed his advice.  He does it very well. 
 MP3 is pretty much a brick wall at 16kHz, and has a slight curve just ahead of that frequency in which the signal declines.
 By boosting (and cutting) the areas Oren mentioned you are trying to make the most out of what the format allows you to keep.  Push it before the MP3 format cuts it, so the end result is a close approximation of the original.
 Also by using compression (carefully) you can give the codec 'more info' to force it to handle it as you want.  Cymbals are an example.  Sometimes the extra ring the compressor gives to the signal by boosting that fading cymbal crash can make a big difference on how the MP3 format handles it..
 I had started studying this before Oren and I met, and now he has surpassed me for knowing what to do to a mix ahead of time to get the desired result.  He's good at it; I use a little trial and error..still..

 I just wish LAME would make a simple installer that installs the codec on your system so other softwares can use it.  It seems now that you have to go the inf route to install it into the system, and sometimes that is a little 'iffy'.  I have codecs that show up under the Lame MP3 listing for certain bitrates and frequencies that never work here, and other bitrates and frequencies from Lame do work here..and I know people that can't get it to work at all that way; they have to use a seperate program to convert to MP# (like Audacity)
Logged

Make your sound your own!

http://www.motagator.net/bands/556/
Oren
Moderator
Kara-Moon Master
*****
Posts: 5444


...just looking for clues...


« Reply #5 on: September 23, 2008, 03:36:17 AM »

Do you mean use a compressor as much as possible without losing dynamics ?

That's exactly what I mean
Logged

Oren
Moderator
Kara-Moon Master
*****
Posts: 5444


...just looking for clues...


« Reply #6 on: September 23, 2008, 03:42:57 AM »

This rather explains something. I tried encoding this myself at a bit rate of only 128k (the default for LAME) and didn't seem to get this effect anywhere near so badly. I didn't pursue it (shame on me) but I'm now wondering if LAME also defaults to variable bit rate.

Yes. MP3, as represented by the LAME codec, is a variable bit-rate compression method. Similar to Ogg Vorbis in this respect.
Constant bit-rate is an available option, but must be specifically selected from a drop-down menu.
« Last Edit: September 23, 2008, 03:55:11 AM by Oren » Logged

Oren
Moderator
Kara-Moon Master
*****
Posts: 5444


...just looking for clues...


« Reply #7 on: September 23, 2008, 03:52:30 AM »

...I just wish LAME would make a simple installer that installs the codec on your system so other softwares can use it... 

Me too!
As it stands, I use Audacity as a G.U.I. "front end" for LAME. It tends to present the application and its various options in the most comprehensive and useable package.
Logged

mlit
Full Member
***
Posts: 188


bada-pisch!


« Reply #8 on: October 30, 2008, 04:47:51 PM »

guys .. guys .. drop the mp3's. FLAC is the way to go!
if you disagree with my input, please give me some constructive feedback on why the MP3 Lame encoder and Ogg Vorbis encoders are better than FLAC .. Smiley
Logged

do not judge music by it's drug!
Oren
Moderator
Kara-Moon Master
*****
Posts: 5444


...just looking for clues...


« Reply #9 on: October 30, 2008, 05:41:56 PM »

guys .. guys .. drop the mp3's. FLAC is the way to go!
if you disagree with my input, please give me some constructive feedback on why the MP3 Lame encoder and Ogg Vorbis encoders are better than FLAC .. Smiley

FLAC is superior in every way.
The file size is a bit large for posting on websites, and some people's download speed is very slow, making the MP3 and Ogg Vorbis more practical for casual listening.
As musicians, however, we should be using FLAC wherever possible.... Afro
Logged

folderol
Kara-Moon Master
****
Posts: 5306

Who? Me?


WWW
« Reply #10 on: October 30, 2008, 07:51:23 PM »

On the few collabs I've done here I've tended to chuck out flac files to my co-musicians for precisely this reason.

For my own personal listening on limited space devices, I use ogg at quality 5, and 128k lame encoded mp3 stuff for the unwashed masses Smiley
Logged

If you have a poem, I have a tune, and we exchange these, we can both have a poem, a tune, and a song.
- Will
mlit
Full Member
***
Posts: 188


bada-pisch!


« Reply #11 on: November 02, 2008, 06:39:56 PM »

On the few collabs I've done here I've tended to chuck out flac files to my co-musicians for precisely this reason.

For my own personal listening on limited space devices, I use ogg at quality 5, and 128k lame encoded mp3 stuff for the unwashed masses Smiley

I second that. If i'm to do a collab i want no less than .wav tracks to work with. There's only 1 person in the whole wide world i give permission to send me mp3 or ogg vorbis compressed mixdowns. a dear friend on the jungle with a 56k dial-up modem(!)  Shocked hahaha
For the masses I'm most likely to do a 192kbps VBR, but a minimum 160kbps mp3. 160kbps CBR is the same compression you get on any cd you buy in the recordstore. 128kbps is fucking (sorry language) rubbish. Drums, espacially cymbals tend to just wash into jittering. as do snares and hi-hats.  Roll Eyes

Shame on you compressing > 128kbps mp3's !!  Evil
Logged

do not judge music by it's drug!
rharv
Use in Moderation
Kara-Moon-Collective
Kara-Moon Master
**
Posts: 1059


Glad to be here


WWW
« Reply #12 on: November 09, 2008, 12:18:08 PM »

IMHO Lame 160 is equal to Fraunhofer Pro codec 128.  Both have their little idiosynchratic issues..one will make an electric piano just intolerable, the other may ruin a ride cymbal...

 Of course wav is the way to go, and ape files have the ability to make wav files very manageable in size with absolutely no loss.  I still think FLAC somehow has an effect when decompressed.  Just my opinion from experimentation.  I'm sure others will point to their claim as lossless compression, but use it and run the files thru an analyzer.. or better yet, use it and run the original and the uncompressed file thru a set of effects using the exact same settings.. see if they sound exactly the same  still..  There have been times when I've heard the difference pop up.
Logged

Make your sound your own!

http://www.motagator.net/bands/556/
Oren
Moderator
Kara-Moon Master
*****
Posts: 5444


...just looking for clues...


« Reply #13 on: November 09, 2008, 01:31:24 PM »

...I still think FLAC somehow has an effect when decompressed.  Just my opinion from experimentation.   ...use it and run the original and the uncompressed file thru a set of effects using the exact same settings.. see if they sound exactly the same  still..  There have been times when I've heard the difference pop up.

I had no idea Shocked A sobering thought....
Logged

folderol
Kara-Moon Master
****
Posts: 5306

Who? Me?


WWW
« Reply #14 on: November 09, 2008, 10:01:36 PM »

...I still think FLAC somehow has an effect when decompressed.  Just my opinion from experimentation.   ...use it and run the original and the uncompressed file thru a set of effects using the exact same settings.. see if they sound exactly the same  still..  There have been times when I've heard the difference pop up.

I had no idea Shocked A sobering thought....
It gets worse!

From an engineering point of view I couldn't accept the idea of a lossless compression system that was not, well, lossless. For this to happen there would have to be some defect in the methodology (or its implementation) and with the amount of exposure, an open-source codec like flac gets, surely this would have been commented on by now ... widely and loudly!

I decided to do some experiments. The source material was one of my own tracks created in Audacity. I then used Audacity to create a Flac, killed and restarted Audacity reloading the file and converting it back to Wav.

I then used md5sum to do a quick integrity check. Lo and behold, the second Wav had a different signature to the first. Loading both files into Audacity I could see absolutely no difference in the waveform - even massively stretching them to see individual cycles. Thinking that maybe some tag data might be different (timestamp etc) I then examined the files with a Hex editor, and at lots of places through the files, compared them side by side. The data was quite different and it wasn't just a time shift - i.e. the same pattern wasn't just slightly later in the file.

As a double blind, I then used the original Wav file and got Audacity to just save a copy. To my amazement this was also different. Thinking that maybe there was some quirk in the original file (even though it was created with exactly the same copy of Audacity) I made a second direct copy. This was yet again different from all the previous ones, as was a third copy from the original file.

This now means that  I have no way of discovering whether Flac is truly lossless or not, as I can't create a stable, repeatable Wav file anyway. I would add, that in spite of the binary differences, I could hear no difference at all, and could see no difference in Audacity. However if the source files are changing then obviously any translation code will do different things each time.
My flabber is ghasted Shocked
Logged

If you have a poem, I have a tune, and we exchange these, we can both have a poem, a tune, and a song.
- Will
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.055 seconds with 20 queries.