MP3
MP3's full name is MPEG layer III audio. It is an older format dating back to the early 90s, but nowadays is by far the most prevalant audio format out there. It is not a bad format by any means but has a few limitations that newer formats have corrected. Most common bitrate used is probably 128kbps, but 192 has caught on a lot more than it used to. LAME 3.97b1's -V2 --vbr-new, a VBR preset (formerly --preset fast standard), is considered the best size vs quality tradeoff, by even the golden ears (audiophiles with way too good hearing for their own good) and is the recommended version at Hydrgenaudio.org. Preset standard is also what I recommend to people wanting to make their own mp3s.
Good mp3 encoders: LAME (especially from 3.9 on with the presets), FhG (more optimised than LAME for non 44.1kHz sampling rates)
Decent mp3 encoders: Xing (side note: althought Xing got a bad reputation about being a bad encoder it really isn't all that bad. Also the first encoder able to produce VBR files)
Bad mp3 encoders: Dist10, Blade, Plugger, Shine, and anything else based closely off the Dist10 sources (Dist10 is the sample encoder provided when you purchase the mp3 specifications)
The layer III specifications supports different bitrates and sampling rates for each different MPEG standard.
MPEG-1 (most common, high quality) -
Sampling rates: 32kHz, 44.1kHz (44.1kHz is CD's sampling rate), 48kHz.
Bitrates: 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, and 320
MPEG-2 (made for smaller size) -
Sampling rates: 16kHz, 22.05kHz, 24kHz.
Bitrates: 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
MPEG-2.5 (made for smallest size, non-official although widely supported) -
Sampling rates: 8kHz, 11.025kHz, 12kHz.
Bitrates: 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160
Bitrates can be per frame and VBR is achieved in mp3 by changing the frame size bits on a per frame basis. If you look at the stream it would be like this as an example - 32, 128, 160, 224, 320, 192, 256... You get the idea.
VBR = variable bitrate, constant quality, unpredicatble filesize
CBR = constant bitrate, variable quality, predictable filesize
ABR = average bitrate, constant to slightly variable quality, mostly predictable filesize. I like to think of ABR as "smart CBR".
MP3 tags are techincally a hack since the mp3's stream format does not specify tags. Common tags include
ID3v1: Fixed tag field sizes and fixed tags. The first tag format made for mp3. Also can be used for some other formats as well. Always takes up 128bytes exactly IIRC. Unofficial standard and widely supported. ID3v1.0 = no track number and ID3v1.1 = track number present.
ID3v2: Non-fixed tags field sizes and non-fixed tags. Most likely the second tag format made for mp3. Pretty much just mp3 uses this one. Very hard for programmers to work with due to the way this tag format stores its data from my understanding. Unofficial standard and widely supported. ID3v2.3 is the most common and best supported. ID3v2.4 has some problems with support or did the last time I checked. Replaygain values can be stored in ID3v2.
APEv1&2: Non-fixed tags field sizes and non-fixed tags. Like ID3v2 but much easier for programmers to work with. Actually structurally it looks a lot more similar to Vorbis comments IMO. Not nearly as widely supported as ID3v1&2. Replaygain values can be stored in APEv2.
General rule is if the player comes across tags it doesn't understand it just skips them. So don't worry too much about corrupting a file with too many tags. I now use ID3v1.1 and ID3v2.3 for my mp3 files since APEv2 borked tag support on my H120 for some files. Just something to be aware of.
MP3 can encode stereo information in several different ways
Mono: Not encoding stereo information at all. Only one channel is encoded.
Dual-channel/Dual-mono: Each channel is encoded independantly with no coupling at all. Not recommended for the reason that a 128kbps file with always have both channels with 64kbps a piece even though one channel might silent and the other is not. 128kbps full stereo is even smarter than that.
Stereo: Each channel is encoded independantly but can share bits due to being coupled. So a 128kbps file might have 80/48 or 64/64; whatever is more efficient.
Mid/Side Intensity Stereo: Used for low bitrates. Channels can be encoded mid/side or left/right. Throws away stereo information to save space though. Recommended only for low bitrates. Shows up simply as joint stereo.
Mid/Side Stereo: Recommended for all bitrates except for the really really low. Channels can be encoded mid/side or left/right depending on which is most efficient on a per frame basis. The smartest stereo mode mp3 has and yields the highest quality. Also shows up as joint stereo, but M/S IS is rarely ever used over 96kbps I believe. Regardless of what has been spread over the years a good MS implementation is far more efficient than plain, simple L/R stereo.
Starting with LAME 3.95 LAME now incorporates a VBR table to supercede the presets. This is similar to the quality settings of Ogg Vorbis and Musepack; just in reverse.
LAME VBR table for 3.95 through 3.96.1
Code:
Switch Equals Target -Y -b Lowpass Resample
-V 0 --preset extreme 240 No 128 19500
-V 0 --vbr-new --preset fast extreme 240 No 128 19500
-V 1 210 No 128 19000
-V 1 --vbr-new 210 No 128 19000
-V 2 --preset standard 190 No 128 19000
-V 2 --vbr-new --preset fast standard 190 No 128 19000
-V 3 175 Yes 18000
-V 3 --vbr-new 175 Yes 18000
-V 4 --preset medium 165 Yes 18000
-V 4 --vbr-new --preset fast medium 165 Yes 18000
-V 5 130 Yes 17000
-V 5 --vbr-new 130 Yes 17000
-V 6 115 Yes 16000
-V 6 --vbr-new 115 Yes 16000
-V 7 100 Yes 14900 32000
-V 7 --vbr-new 100 Yes 14900 32000
-V 8 85 Yes 12500 32000
-V 8 --vbr-new 85 Yes 12500 32000
-V 9 65 Yes 10000 24000
-V 9 --vbr-new 65 Yes 10000 24000
Current VBR table for 3.97 branch
Code:
Switch Equals Target -Y Lowpass Resample
-V 0 --preset extreme 210-270 No 19500
-V 0 --vbr-new --preset fast extreme 210-270 No 19500
-V 1 200-250 No 19000
-V 1 --vbr-new 200-250 No 19000
-V 2 --preset standard 170-230 No 18600
-V 2 --vbr-new --preset fast standard 170-230 No 18600
-V 3 140-210 Yes 18000
-V 3 --vbr-new 140-210 Yes 18000
-V 4 --preset medium 130-190 Yes 17500
-V 4 --vbr-new --preset fast medium 130-190 Yes 17500
-V 5 110-170 Yes 16000
-V 5 --vbr-new 110-170 Yes 16000
-V 6 100-150 Yes 15600
-V 6 --vbr-new 100-150 Yes 15600
-V 7 90-130 Yes 14900 32000
-V 7 --vbr-new 90-130 Yes 14900 32000
-V 8 70-110 Yes 12500 32000
-V 8 --vbr-new 70-110 Yes 12500 32000
-V 9 50-80 Yes 10000 24000
-V 9 --vbr-new 50-80 Yes 10000 24000