Help - Search - Members - Calendar
Full Version: MP3 Frame size
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - General
shearerkazaa
As we all know, MP3 files consists of lots of frames. What's the size of a frame? Does it depend on the bitrate?

Thanks
JensRex
I found this formula once, when I was coding an MP3 frame analyzer:

FrameSize = 144 * BitRate / (SampleRate + Padding)

So yes, it does depend on the bitrate.

F.x.: 144 * 128000 / (44100 + 1) = ~417

The real result is 417,9497..., but you just Int() it to get 417, and it works fine. It seems a little odd to me, but it worked fine in my application.
Sunhillow
QUOTE(shearerkazaa @ Jan 23 2003 - 06:11 PM)
As we all know, MP3 files consists of lots of frames. What's the size of a frame? Does it depend on the bitrate?

Thanks

Yes, as always: it depends...

one frame contains 1152 audio sample values. The actual lentgh of a Frame depends on bitrate, sampling frequency (and eventually one padding byte)

Using a samling rate of 44.1 kHz, the frame size is from 104 (+1 padding) byte (32 kBit/s) to 1253 (+1 padding) byte (320 kBit/s)
shearerkazaa
QUOTE(JensRex @ Jan 24 2003 - 12:16 AM)
FrameSize = 144 * BitRate / (SampleRate + Padding)

Thank you both. I'll keep the formula somewhere handy.

Oops something else....is the padding always 1 byte?
Sunhillow
QUOTE(shearerkazaa @ Jan 23 2003 - 07:40 PM)
Oops something else....is the padding always 1 byte?

Yes. The reason is to keep the data rate at the given value.

Padding is only necessary for 44.1 kHz

[edit]: inserted an "e" dry.gif
Satya
whenever padding bit is set, then that frame contains additional slot to adjust the mean bit-rate to the sampling frequency.

padding is "only" necessary at 44.1 kHz but it "may not" required for some frames.
It totally depends upon the input test vector.
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.