Search code examples
androidaudiobytemp4aac

Why is the size of audio sample in mdat atom of mp4 file more than 300 bytes?


I have a mp4 file. When I work with its mdat atom, I see that audio data is stored in the samples. The size of each sample is more than 300 bytes (usually around 370 bytes) and less than 600 bytes.

I wonder why? Maybe it's a stupid question. But cannot find the answer. Please help me! The audio parameters of my mp4 file: 44100 Hz, bitrate: 128000


Solution

  • Your are trying to find out why the encoded AAC frame size is around 370?

    Sampling rate = 44100 [pcm samples/sec]
    Decoded AAC frame size = 1024 [pcm samples/frame]
    Bitrate = 128000 [bits/sec]

    therefore ([bits/sec]/[samples/sec]*[sample/frame]=[bits/frame])

    1 AAC frame = 371 [bytes/frame]

    Actual frame sizes differ (AAC specification is not strict, this depends on encoder implementation), but on average they should be 371 in order to target the 128000 bitrate.