Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Two stupid(?) questions about LAME (Read 16291 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Two stupid(?) questions about LAME

Hello all.  As you can see, I'm new to the boards, but have perused them as a guest for some time.

I'm still trying to learn the ins and outs of audio archiving, and after doing considerable reading I've started archiving my CD collection with LAME, using the -V0 and -q0 (highest quality VBR) settings.


I have two (potentially stupid) questions for those more experienced than I:
(1) Do you see any point in recompressing my CDs using LAME 3.99.5?  The vast majority of them are already compressed with 3.98.4.  3.99.5 seems to give a small file increase on the higher quality settings, but I'm really only concerned about the audio quality.


(2) I've noticed that LAME VBR always uses MPEG 1-Layer III bitrates (32, 40, 48 ... 320), presumably because CDs are always at a 44.1kHz sample rate.  Would it be possible to combine MPEG 1 and MPEG 2/2.5 (8, 16, 24...144, 160) bitrates in the same file?  If so, would those be readable by most players?  And what about using freeformat options e.g. 288 or 640 kbps?
I'm thinking that allowing MPEG 1 and MPEG 2/2.5 in the same file, if that's possible, would allow VBR files to be a bit smaller with no quality loss - since silent sections, for example, could be encoded at 8 kbps instead of 32.  And it'd be nice to have freeformat options above 320 kbps available since this is for archiving.

Two stupid(?) questions about LAME

Reply #1
Why in this day of cheap storage would you "archive" in a lossy format? 

Why if you have already decided, not only to "archive" in lossy, decided to "archve" in the most audibly problematic of lossy formats?  To the point where you're pissing over the most insignificant of details.

An expensive external hard drive is $200 for 1TB

That should hold ~2500 FLAC rips if my math is correct.

You want two drives (one for backup).

That's sixteen cents per CD to store in FLAC. 

Mind you it would be only a hair less than half that to do it in MP3.

So we'll be generous and say the delta is ten bloody cents per CD rip...

EDIT:  Forgot a key word. 
Creature of habit.

Two stupid(?) questions about LAME

Reply #2
(0) http://wiki.hydrogenaudio.org/index.php?title=LAME:
Quote
For archiving, only lossless formats like WavPack, FLAC, etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.


(1) I can't see any reason for re-ripping, usually 3.98.4 -V0 isn't better than 3.99.5 -V0.

(2a) About MPEG 1 and MPEG 2/2.5 in the same file: AFAIK there are no encoders that can do this.
(2b) Freeformat is not supported by most players.

Two stupid(?) questions about LAME

Reply #3
Why in this day of cheap storage would you "archive" in a lossy format?  ]

Heh, I should have guessed that the first response would be questioning why I went lossy instead of lossless!

There are two reasons.  First, the near-universal compatibility of MP3s; and second, because frankly I can't tell the difference between a -V0 -q0 MP3 and an AAC or ATRAC, even when it's played on high-end equipment.  I've tried--several times--using ABXY tests.  Though to tell the truth, I may redo everything in AAC, ATRAC or FLAC before I'm done anyway.

So...just humor me on the MP3 questions, mkay?

EDIT: Thanks for the responses Ivqcl.

Two stupid(?) questions about LAME

Reply #4
First, the near-universal compatibility of MP3s; and second, because frankly I can't tell the difference between a -V0 -q0 MP3 and an AAC or ATRAC, even when it's played on high-end equipment.


1 - If you can't hear the difference why are you splitting hairs about fringe behaviors of the encoder? 

2 - If you can't hear the difference why is a 640kb frame needed?

3 - If the near-universal compatibility is really a reason why are you asking about incompatible variants?

Rip to lossless, and transcode to lossy upon transfer to your DAP/Phone/Car for the next fiveish years.  After that your portable devices will hold enough to make the transcoding step unneeded.
Creature of habit.

Two stupid(?) questions about LAME

Reply #5
1 - If you can't hear the difference why are you splitting hairs about fringe behaviors of the encoder? 

2 - If you can't hear the difference why is a 640kb frame needed?

3 - If the near-universal compatibility is really a reason why are you asking about incompatible variants?

Rip to lossless, and transcode to lossy upon transfer to your DAP/Phone/Car for the next fiveish years.  After that your portable devices will hold enough to make the transcoding step unneeded.

To be perfectly honest, it was more curiosity than anything
And I wasn't completely sure that these were incompatible variants--the reading I'd done indicated they probably were, but I thought perhaps the sources I'd read were out of date.

Anyway, thanks for answering my questions.  Now I just need to read up on which of the lossless compression codecs to use when/if I do that...If you have an opinion I'm all ears, so to speak!
(Encoding time is of no consequence to me...I'm interested in whichever lossless codec compresses best without an insane decoding time, and is at least fairly widespread.)

Two stupid(?) questions about LAME

Reply #6
@ BFG

Have you seen this page?
Code: [Select]
http://wiki.hydrogenaudio.org/index.php?title=LAME


CBR will give you the best compatibility. But.... VBR will give you the best audio quality for MP3 format.

Stay away from ABR and Free Format

Two stupid(?) questions about LAME

Reply #7
(1) Do you see any point in recompressing my CDs using LAME 3.99.5?  The vast majority of them are already compressed with 3.98.4.  3.99.5 seems to give a small file increase on the higher quality settings, but I'm really only concerned about the audio quality.


From the responses above, you don't have your library ripped to a lossless format. That would mean not only "recompressing" your CDs, but reripping them as well. Don't bother. That's a lot of work for relatively little benefit. Or perhaps you were thinking of taking the 3.98.4 encodedMp3 files, decoding them, and then re-encoding them using LAME 3.99.5? That would give you files of worse quality than you have now, even if LAME 3.99.5 was far superior to 3.98.4, because you'll have put the audio through two lossy encodings.

That highlights the biggest problem with ripping your CD collection and storing it only in Mp3 or another lossy format. Even if you can't tell the difference between the Mp3s and the original CDs, if you _do_ at some point want to re-encode your music using a beter Mp3 encoder, or maybe to a lower bitrate/quality Mp3 for use in portable players, you're stuck. That's why many people encourage ripping and storing the CDs in a lossless format like FLAC, from which you can encode, or re-encode to your hearts' delight, with no additional work on your part, and no further loss in quality.

Two stupid(?) questions about LAME

Reply #8
CBR will give you the best compatibility. But.... VBR will give you the best audio quality for MP3 format.


I don't think VBR compatibility is going to be problematic.  A device still pops up from time to time having issues with Lame VBR mp3 files but they are very few and far between the amount of players/programs that play them back just fine.  VBR compatibility wouldn't be on my "worry list" (at all) when deciding what Lame setting to use.

Two stupid(?) questions about LAME

Reply #9
frankly I can't tell the difference


Then why on earth re-rip and re-encode?


Re CBR for compatibility, in case that should ever be a problem: it is possible to convert between VBR and CBR without quality loss, using mp3packer. That's a utility which doesn't decode and re-encode, merely reorganizes the frames.

Two stupid(?) questions about LAME

Reply #10
CBR will give you the best compatibility. But.... VBR will give you the best audio quality for MP3 format.

Will VBR give you better quality than 320 kbit CBR?  How did you determine this?

If CBR and VBR both managed to give transparent results how can you claim one provides better quality than the other?

The answer is you can't!  As such, silly generalizations such as this should be dismissed.

Two stupid(?) questions about LAME

Reply #11
It is maybe fruitful to point out what is correct, and merely not what is wrong: VBR aims at maximizing quality at whatever the average bitrate output becomes (which is not the same as to say “a given predetermined average bitrate”), and for every given CBR file, there is a VBR file which does indeed achieve the same quality without increasing size.

 

Two stupid(?) questions about LAME

Reply #12
... for every given CBR file, there is a VBR file which does indeed achieve the same quality without increasing size.

As long as you're not talking about converting a CBR320 file to a VBR file using mp3packer (a procedure which doesn't change the audio data) that's not correct. The CBR and VBR audio data creation processes are different. Quality can be better with -V0 or CBR 320 depending on the sample (proven fact according to corresponding HA threads). Maybe there's a quality bias towards one of the methods (historically contributed to CBR 320 by most people), but nobody knows especially as with 3.99.5 -V0 quality was further increased.
lame3995o -Q1.7 --lowpass 17

Two stupid(?) questions about LAME

Reply #13
I thought I read that the CBR and VBR modes now share the same psychoacoustic model in 3.99.

I can't speak for Porcus, but I do think he was alluding to mp3packer, as it seems discussion about it has increased lately. Lastly, he was quite right in providing a correct answer rather than getting annoyed with flawed information as I had done.


Two stupid(?) questions about LAME

Reply #14
... for every given CBR file, there is a VBR file which does indeed achieve the same quality without increasing size.

As long as you're not talking about converting a CBR320 file to a VBR file using mp3packer (a procedure which doesn't change the audio data) that's not correct.


Logic: Best VBR algorithm is at least as good as (and likely better than) CBR-->repack is at least as good as (and usually better than) CBR.


I actually wrote a couple of lines on why mp3packer is a sufficient condition to justify the claim, but deleted them in order not to confuse the discussion with anything that could be read as a recommendation to create VBRs in that particular way. Obviously, when for once I tried to avoid unnecessary nitpickery, I failed. I'll remember that

Two stupid(?) questions about LAME

Reply #15
@greynol:
Yes, somebody recently wrote that CBR and VBR mode share the same psychoacoustic model in 3.99, and IIRC he referred to the change log. I just looked up the change log but could not find a corresponding entry.
Moreover, as I know a bit about the Lame source code, I don't know what the sentence 'share the same psychoacoustic model' means. Sure there's a lot in common with the CBR and VBR audio data creation process, but this doesn't change the fact that the corresponding audio data streams are significantly different.

@Porcus:
OK, you talked about using mp3packer. That's a correct statement of course, but it has nothing to do with Lame's CBR and VBR mode.
lame3995o -Q1.7 --lowpass 17

Two stupid(?) questions about LAME

Reply #16
If compatibility is what you are worried about then flac is the most compatible.

You can not play flac on as many devices but it has a FOSS license that allows it to be compiled and distributed for any platform and it can be included in other software as well.

No matter what computer platform you use, you will almost certainly be able to get a legal and free flac encoder / decoder that you can then use to create whatever lossy format you may need.

MP3 is controlled by software patents that are a problem in some countries like the US. These patents still have about 5 years left on the last of them.

This patent issue prevents mp3 from playing on some platforms. For example, FireFox and Opera will not native play mp3.
Like flac, you can get free and often legal decoders for any platform so you can transcode as needed. If you had a need for your audio to play in Opera you could transcode from mp3 to Ogg Vorbis. But that's lossy to lossy. Go with flac and your flac to Ogg Vorbis is lossless to lossy, which is better.

Even though not as many hardware players support flac numerically, it still is the more compatible format because when the need to transcode does arise (and it always will at some point) it decode of the flac is free and the transcode does not involve lossy to lossy.

flac also supports better tagging than ID3 (used by mp3) and is thus superior for archival purposes where you want information about the file stored with the file.

Two stupid(?) questions about LAME

Reply #17
Are you really suggesting that Lame's VBR mode is outperformed by Lame CBR --> mp3packer (for same bitrate)?

Two stupid(?) questions about LAME

Reply #18
If you're addressing me: No, I don't, and I can't see I've written something like this. Personally I'm into -V0 (resp. my 3.99.5 -V0+ variant which is a bit more demanding than -V0).
lame3995o -Q1.7 --lowpass 17

Two stupid(?) questions about LAME

Reply #19
If you're addressing me: No, I don't, and I can't see I've written something like this. Personally I'm into -V0 (resp. my 3.99.5 -V0+ variant which is a bit more demanding than -V0).

Yes I was, sorry for not quoting.

The logic is that as long as Lame VBR is at least as good as mp3packed CBR (at the same bitrate), then it is at least as good as CBR (at the same or slightly higher bitrate), and that would – under the hypothesis (the 'as long as' part) establish my claim.

The 'then' part is trivially true, as it is the very same signal. Therefore, in order to invalidate my claim, it would have to be due to the hypothesis failing, and Lame's optimized-for-quality VBR algorithm not even being on par with repacked CBR, which is not optimized for quality. Hence the question.


Of course the quality optimization need not be perfect in the sense that no signal can fool it (that's why a model is called a model – it isn't the real thing), but it would be a surprise if the effort of optimized VBR were totally (edit) more often than not in vain.

Two stupid(?) questions about LAME

Reply #20
If compatibility is what you are worried about then flac is the most compatible.


That seems like a few steps backwards when compared with the compatibility (across software and devices) that mp3 (and even mpeg-4 AAC) offers.  I would even question the validity of saying that FLAC is the most commonly supported lossless format since the majority of portable players sold are made by Apple and natively work with ALAC (not to mention third party support across various devices and programs).  I am not trying to question FLAC at all but rather I don't understand how it can offer greater compatibility over mp3 especially since every single portable audio player, smartphone, Blu-ray player, computer, the two main gaming consoles (soon to be three), tablet, and the majority of dedicated DVD players (if people are still buying those) all natively work with mp3 files whereas a small percentage of those work with FLAC.

Two stupid(?) questions about LAME

Reply #21
They are compatible with ALAC today, now, but AAC has patent issues just like MP3 does, and I believe they will last even farther into future than MP3 patents, which restricts devices and software that support the format to those who either ignore the patents, are sold in countries where there aren't patents, or ignore the patents (like happened with MP3 during it's initial decade).

You might have to download software to decode flac on some platforms but that software is both free and readily available just about anywhere.

Can I play an ALAC file on Linux?

I purchased the fluendo plugins so maybe I can, but without that purchase it is only possible with third party libraries that can not legally be distributed by my distribution vendor, meaning either I have to compile myself and watch for security patches myself or trust a third party repository in another country that unlikely has a commercial entity behind it.

That's a problem that doesn't exist with flac, where bona-fide companies can choose to distribute support with their products (like foobar2000), far more trust-able than a small group who run a server outside the US for explicit purpose of circumventing patent distribution laws.

I believe, btw, there are quicktime plugins for flac that make flac work in QuickTime and thus iTunes, no?

Two stupid(?) questions about LAME

Reply #22
Getting Flac to play in iTunes is a total pain, even then it doesn't work well. Not worth the effort. The fact is that more people have software and devices that play ALAC than Flac. MP3 is still king for compatibility.

Two stupid(?) questions about LAME

Reply #23
You can still install the command line client and decode flac in OS X.
ALAC won't decode for me, apparently not even with the patent infringing libraries, not yet anyway.

So you can decode flac more places than alac. Maybe not OOB w/o installing additional software, but installing additional software is not only an option but is free - which it isn't with ALAC.
Thus flac is more compatible.

EDIT - looks like some recent ffmpeg do support alac, but it does not appear that GStreamer does.

Two stupid(?) questions about LAME

Reply #24
1: Last month I bought a 2TB Hitachi drive for $110 + tax.
2: An archive possibility is to use BluRay discs - 23 GB for under a buck. Writers under a hundred. You can likely get 40 CDs in FLAC on 1 1$ disc. Hard to beat that price
In my car I use 320 KBit MP3s on a $20 32GB flash drive but the 'masters' are stored as FLAC.