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: Mp3 VBR and "bitrate" in file info (Read 11641 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Mp3 VBR and "bitrate" in file info

Hey. I was wondering: in a mp3 VBR, the file has in its information a determined bitrate. What does this bitrate mean if the file is in VBR ?
For example, a VBR 0 has a 166 kbps, but oftenly a VBR 0 has more than 220kbps.

And for example, if I have a mp3 320kbps CBR, and convert it to mp3 VBR 0, if the mp3 in CBR was in 320kbps, but in fact was of less quality (lets say it was put at 320kbps but before that was in 160kbps CBR). The VBR 0 algorithm will take that mp3 and the result is according to the real quality, so it will show the kbps info at 166 kbps?

My question is, if I have 2 songs that doesn't differ much in "complexity", at 320kbps CBR, and convert to VBR 0. Why one of those two take down to 166kbps while the other one takes to 230kbps? In the file info.

Re: Mp3 VBR and "bitrate" in file info

Reply #1
The encoder can write any value it wants for the bitrate in the VBR tag (which is just hints for the player), but normally this value will just be the average bitrate across all the frames—i.e. sum the bitrates and divide by number of frames.

Your question about complexity assumes that the two songs are equal in complexity, but it seems pretty likely they are not equal if you getting a ~64 kbps difference from the same encoder with the same settings.

To explain further: the audio data in the MP3 is divided into frames, each containing info for constructing 1152 (or sometimes 384 or 576) samples, 1152 being usually ~26 ms of audio. Each frame will be one of the standard sizes, expressed as a bitrate: 320, 256, 224, 192, 160, 128, and so on. In VBR mode, the encoder strives to maintain constant quality by choosing the best bitrate for each frame.

LAME's VBR algorithm has you choose a quality level (0=highest, 9.999=lowest). This does set some caps on the max bitrate per frame; in a VBR 9.999 file, there won't be frames over 64 kbps, and some frames may be as low as 8 kbps. Similarly, a VBR 0 file can have some 32 kbps frames (e.g. for pure silence) but most of them will be much higher, closer to 256 or 320, at least for the average stereo non-classical song. You can see the bitrate distribution when you encode with LAME on the command line. There is also software which will let you view it in already-created MP3s.

The actual distribution can be affected by the "complexity": (roughly) the number of frequency components which must be preserved in each frame, and how efficiently that information can be stored without introducing an unacceptable level of noise. Generally speaking: noisy, loud, strongly stereo material will tend to be more "complex" and require more space, whereas quiet, mono, and tonal material will tend to require less space. However our ears can tolerate more added noise from high compression levels if the music is already noisy, so it is difficult to predict just how much the difference in bitrate distributions will be; I ran some tests with minimal, tonal music and extreme noise, and found that distribution was not very different.

By the way, there is no point to converting CBR to VBR. You are just lowering the quality any time you transcode MP3 to MP3. However there is one program which will do it without quality loss: MP3packer. It will just help you save a small amount of disk space by rearranging the audio data such that the frame sizes are as small as they possibly can be. For a 320 kbps CBR file you will find that some of the frames can be 256 kbps, thus dropping the average down to something in between 256 and 320. Likewise, you could use MP3packer to bloat the bitrate and make a VBR or low-bitrate CBR file use nothing but 320 kbps frames... so it would be 320 kbps CBR but with no change in quality, just wasting space with padding.

Re: Mp3 VBR and "bitrate" in file info

Reply #2
Thanks, is a very clear answer.

I also convert some flac files to mp3 VBR, as in many discussions the conclusion is that VBR is more quality than CBR, but not sure of that.

To convert the mp3 CBR to VBR, and the flac to mp3 VBR I use audacity, mostly because I cut off large silences at begin and end of songs. Is audacity good for convert, talking about quality?

Re: Mp3 VBR and "bitrate" in file info

Reply #3
Quote
I also convert some flac files to mp3 VBR, as in many discussions the conclusion is that VBR is more quality than CBR, but not sure of that.
In most cases VBR is better for the same average bitrate because a higher bitrate is used for parts of the song where it's needed and a lower bitrate is used where a lower bitrate can be used.

LAME is the "smartest" when using VBR and Joint Stereo.

But, if you can't hear a difference between the two files (or between either MP3 and the original FLAC) you can't say one is better than the other...    At higher bitrates the differences are smaller or non-existent.   If you are trying to get the maximum compression (lower bitrates) VBR should give you better results.

And, you're never going to get an average bitrate of 320kbps with VBR (at least I've never seen that).   

Quote
To convert the mp3 CBR to VBR
Don't do that unless you need smaller files.  Multiple lossy compression will (potentially) degrade sound quality, even if you convert to a higher bitrate.

Quote
and the flac to mp3 VBR I use audacity, mostly because I cut off large silences at begin and end of songs. Is audacity good for convert, talking about quality?
Audacity uses LAME so it's just as good as any LAME encoder.   Of course, you should edit the FLAC and compress to MP3 ONCE as the last step.      (There is a program called MP3DirectCut if you want to edit MP3s without multiple generations of lossy compression.)




Re: Mp3 VBR and "bitrate" in file info

Reply #4
The easiest way to contextualize the difference between VBR and CBR is that VBR gives you constant quality, but variable bitrate, and CBR gives you variable quality, but constant bitrate.

Unless you have some kind of old MP3 player that can't handle VBR, there's no reason to use CBR at all.

Re: Mp3 VBR and "bitrate" in file info

Reply #5
I second the recommendation for mp3DirectCut (Windows app) if you want to trim silence from mp3s. It has some quirks but does well enough. Tip: Ctrl+W to save the edited file. For trimming from FLAC you may be interested in the command-line app shntool. It is also possible with SoX or FFmpeg.

Re: Mp3 VBR and "bitrate" in file info

Reply #6
The easiest way to contextualize the difference between VBR and CBR is that VBR gives you constant quality, but variable bitrate, and CBR gives you variable quality, but constant bitrate.

Unless you have some kind of old MP3 player that can't handle VBR, there's no reason to use CBR at all.
I'm not sure switching bitrates from 320kb/s down to 32kb/s in VBR mode will always give better results then 320kb/s CBR.

Re: Mp3 VBR and "bitrate" in file info

Reply #7
Thanks for the software recomendations, I've been looking and already downloaded some of the programs.

So, from what I read, if I take a mp3 320kbps and convert it to VBR 0 (motivated by a save in space, but more by a eficient use of space and quality) it will loss some quality, because compression I guess. A program is listed in this topic that do the CBR -> VBR without loss of quality (MP3packer), I read some about what does the program, but I have not so clear if this program converts the audio, like when using lame (either mp3 -> mp3 or lossles -> mp3), or is something diferent? If is something diferent, how it  does it?

Re: Mp3 VBR and "bitrate" in file info

Reply #8
The easiest way to contextualize the difference between VBR and CBR is that VBR gives you constant quality, but variable bitrate, and CBR gives you variable quality, but constant bitrate.

Unless you have some kind of old MP3 player that can't handle VBR, there's no reason to use CBR at all.
I'm not sure switching bitrates from 320kb/s down to 32kb/s in VBR mode will always give better results then 320kb/s CBR.

Of course, if the VBR algorithm is 'dumb' and reduces the bitrate by too much, even at a high quality setting, then yes. With CBR you're 100% sure which bitrate is used, but you're also wasting space encoding things like silence or very simple passages at a way too high bitrate compared to what is needed.

I think LAME has proven itself beyond a shadow of a doubt to have a very robust and dependable VBR mechanism. Sure, you can argue that if an album takes up 100MB in VBR -V0 and 130MB in 320kbps CBR, that's only 30MB, but it adds up, especially for mobile players.

Re: Mp3 VBR and "bitrate" in file info

Reply #9
The easiest way to contextualize the difference between VBR and CBR is that VBR gives you constant quality, but variable bitrate, and CBR gives you variable quality, but constant bitrate.

Unless you have some kind of old MP3 player that can't handle VBR, there's no reason to use CBR at all.
I'm not sure switching bitrates from 320kb/s down to 32kb/s in VBR mode will always give better results then 320kb/s CBR.
I think LAME has proven itself beyond a shadow of a doubt to have a very robust and dependable VBR mechanism. Sure, you can argue that if an album takes up 100MB in VBR -V0 and 130MB in 320kbps CBR, that's only 30MB, but it adds up, especially for mobile players.
That reminds me when, back around 2001-02, I was starting to think that difference was a fad soon to be surpassed.

Fast forward a decade and a half (and numerous DAPs ranging from a Creative Jukebox to a Palm Tungsten, plus all lossy encoders you can poke a stick at) and I still find myself enjoying this LAME VBR's ad hoc 30% extra space in its full advantage, either on a memory stick for in-car usage or then on my Motorola smartphone that strangely still has no SD card slot.

Who'd have guessed it then?
Listen to the music, not the media it's on.
União e reconstrução

Re: Mp3 VBR and "bitrate" in file info

Reply #10
So, from what I read, if I take a mp3 320kbps and convert it to VBR 0 (motivated by a save in space, but more by a eficient use of space and quality) it will loss some quality, because compression I guess. A program is listed in this topic that do the CBR -> VBR without loss of quality (MP3packer), I read some about what does the program, but I have not so clear if this program converts the audio, like when using lame (either mp3 -> mp3 or lossles -> mp3), or is something diferent? If is something diferent, how it  does it?
When you select a CBR setting that is overkill, sometimes there is simply unused space within the file. MP3packer simply removes this and repacks the audio data into a smaller, VBR file. There is no change at all in the audio data so no loss in quality.

Re: Mp3 VBR and "bitrate" in file info

Reply #11
Part of MP3 encoding involves a lossless compression step where zlib-style compression is applied to the frame's payload. There are settings for it which trade encoding speed for a slightly larger file size. Just like in zip or gzip, there is a setting where you can choose how much effort to put into the compression. More effort = slower encoding, but smaller size. MP3 encoders generally don't go for maximum compression because it's so slow and the space savings is not that much. But you can use MP3packer with the -z switch to have it do the maximum compression, and this can result in the data fitting into smaller frames now and then, maximizing the efficiency even more than just what its normal repacking of CBR data in VBR frames can accomplish.