Help - Search - Members - Calendar
Full Version: Lame CBR still produces VBR?
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
King Pong
I'm trying to create CBR files for a streaming system, and the files need to be CBR 96kbps. But using "lame -b 96" seems to create files with a constant 96 kbps, but with the VBR header turned on. This is confusing the software I have to deal with.

Is there a way to tell Lame to turn off the VBR header? The --cbr flag doesn't appear to make a difference.

Example:
CODE
$ faad -qw intro.m4a | lame -r --resample 44.1 -b 96 - intro.mp3
Assuming raw pcm input file
LAME 3.98 (beta 8, Apr 14 2008) 32bits (http://www.mp3dev.org/)
Using polyphase lowpass filter, transition band: 15115 Hz - 15648 Hz
Encoding <stdin> to intro.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (14.7x)  96 kbps qval=3

$ perl -MMP3::Info -le 'print get_mp3info(shift)->{VBR}' intro.mp3
1

CBR files created by iTunes have the VBR header off:
CODE
perl -MMP3::Info -le 'print get_mp3info(shift)->{VBR}' from_itunes.mp3
0


UPDATE: Solution is to use -t flag to lame
SamHain86
If I recall correctly, the LAME 3.98 beta is designed to use VBR as default, not CBR. You will need to look in the configuration to set the encoder to make CBR.
Just looking at the options, I think you need to have --cbr first, else the -b is also an option for the VBR.

CODE
lame --cbr -b 96 - intro.mp3
King Pong
Thanks for the reply. Unfortunately, --cbr doesn't seem to change it:
CODE
$ lame --cbr -b 96 intro.wav intro.mp3
LAME 3.98 (beta 8, Apr 14 2008) 32bits (http://www.mp3dev.org/)
Resampling:  input 44.1 kHz  output 32 kHz
Using polyphase lowpass filter, transition band: 15097 Hz - 15484 Hz
Encoding intro.wav to intro.mp3
Encoding as 32 kHz j-stereo MPEG-1 Layer III (10.7x)  96 kbps qval=3
...
Writing LAME Tag...done
ReplayGain: +7.8dB

$ perl -MMP3::Info -le 'print get_mp3info(shift)->{VBR}' intro.mp3
1
lvqcl
From lame --longhelp:
-t disable writing LAME Tag

Or you need something else?
King Pong
QUOTE(lvqcl @ Apr 16 2008, 11:40) *

-t disable writing LAME Tag


Thanks! That did it. I don't really understand what the "LAME Tag" has to do with the VBR field, but I don't need to -- it works.

Much appreciated.
Jebus
QUOTE(King Pong @ Apr 16 2008, 09:46) *
QUOTE(lvqcl @ Apr 16 2008, 11:40) *

-t disable writing LAME Tag


Thanks! That did it. I don't really understand what the "LAME Tag" has to do with the VBR field, but I don't need to -- it works.

Much appreciated.


Just in case you're curious...

The Lame tag includes, and is an extension of, the "Xing header" which is a silent frame of audio at the beginning containing useful information for VBR playback, like the # of frames etc. Without it, you can't calculate the average bitrate and playtime without reading in every single frame in the file. The Lame extension contains some additional info like version and encoding options used. It's included in CBR files too, because the additional Lame information is useful, but it certainly isn't necessary for CBR playback.


The Xing header is certainly not a part of the MPEG specifications. In fact, the fraunhoffer codec uses a totally different header (VBRI) to the same purpose.
Sebastian Mares
I didn't follow the technical changes in LAME - do CBR files now also contain a Xing header which is marked as such (Xing) or does LAME still write Xing for VBR and Info for CBR?
robert
QUOTE(Sebastian Mares @ Apr 16 2008, 20:01) *

I didn't follow the technical changes in LAME - do CBR files now also contain a Xing header which is marked as such (Xing) or does LAME still write Xing for VBR and Info for CBR?

LAME still writes Xing for VBR encodes and Info for CBR/ABR encodes.
The Info frame contains some useful information for CBR files too (gapless playback):
http://gabriel.mp3-tech.org/mp3infotag.html
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.