Log in

View Full Version : Lame 3.95.1: medium preset v. CBR?


evilclive
14th June 2007, 17:39
Lame 3.95.1 offers a number of presets for people who are more interested in quality than bit rate. The "medium" preset offers nearly transparent sound quality, and averages about 152kbps.

However, the overhead in an AVI file is a little greater for VBR encodings, so 160kbps CBR is no larger than medium preset VBR.

My source recordings are 224kbps CBR MP2 audio, and I am at a loss as to why Lame wants to encode some frames from this source at 320kbps.

Presumably, with a lossy source, the sound quality of the converted file is going to be imperfect but nearly transparent, whether I use medium-preset VBR or 160kbps joint-stereo CBR? Is there any theoretical advantage to using one over the other?

Arite
14th June 2007, 18:17
Lame 3.95.1 offers a number of presets for people who are more interested in quality than bit rate. The "medium" preset offers nearly transparent sound quality, and averages about 152kbps.

However, the overhead in an AVI file is a little greater for VBR encodings, so 160kbps CBR is no larger than medium preset VBR.

My source recordings are 224kbps CBR MP2 audio, and I am at a loss as to why Lame wants to encode some frames from this source at 320kbps.

Presumably, with a lossy source, the sound quality of the converted file is going to be imperfect but nearly transparent, whether I use medium-preset VBR or 160kbps joint-stereo CBR? Is there any theoretical advantage to using one over the other?

Lossy to lossy transcoding will always reduce audio quality - it is not recommended unless completely necessary. MP3 does not transcode very well from one format to another, however I do not know about MP2.

VBR tries to optimise the encoding to get the best quality output whilst still retaining a low average bitrate (~165kbps in your case). The source is irrelevant in this respect - lossy or lossless, selecting VBR will adjust the bitrate accordingly to get an optimumly high quality output (so simple quiet samples will have low bitrates, loud complex samples will have high bitrates).

So, assuming that you MP2 source is transparent/almost transparent, VBR is your best option as the resulting output should be perceivably "truer" to the original. The areas at which you stated 320kbps sample frames were used are presumably loud/have high levels of complexity and so are allocated a higher bitrate. Even if you were to transcode from 224kbps CBR MP2 >> 320kbps CBR MP3, there would still be a quality loss. The only way to retain the same quality would be to transcode to a lossless medium, hence why lossy to lossy transcoding is not recommended.

Nevertheless - VBR is recommended over ABR, which is recommended over CBR. Even if the VBR is on average a lower bitrate than the CBR, the quality at should be higher as it adjusts relatively to the current sample frame.

So, I would recommend sticking with VBR. LAME 3.95.1 is now a long obsolete LAME version - 3.97 is the current stable version, and I would recommend the latest beta, 3.98 beta 3 (3.98 now uses "--vbr-new" as default). In 3.97 "--preset-medium" corresponds to "-V 4", which is ~165kbps VBR ("--preset-fast-medium" is the same but with "--vbr-new"). Get the latest LAME releases (3.97, 3.98b3) from here (http://www.rarewares.org/mp3-lame-bundle.php).

Hope that helped :). Cheers, Arite.

evilclive
15th June 2007, 16:20
:thanks:

I think the MPEG-layer-2 support is broken in LAME 3.98 beta 3:

C:\> LAME SOURCE.MP2 TARGET.MP3

(Long pause)

Error reading headers in mp3 input file SOURCE.MP2

It works OK in LAME 3.97.

foxyshadis
16th June 2007, 08:32
If you want an intuitive reason why a codec will struggle with areas another codec coded with a lower bitrate:

First, decode->encode is never lossless, there are some approximations made on both steps (though better-designed codecs, including lame and most AAC encoders, easily minimize this factor). Then, different codecs will partition and encode areas in totally different ways; vorbis can badly stumble over mp3 decoding artifacts that lame would quantize away. Finally, encoding with a higher lowpass or higher quality level will end up encoding the artifacts that would otherwise be quantized away.