PDA

View Full Version : Overhead calculation for MP4


Inventive Software
25th January 2006, 11:22
Does anybody know how to calculate the overhead for an MP4 file? For instance, is it different for ASP and AVC video streams, and for MP3 and AAC audio streams?

AVI's calculation is easy. 24 bytes per interleaved chunk for the first 2 GB, then 16 bytes thereafter. But I don't know how simple or complicated MP4's overhead is.

mediator
25th January 2006, 13:07
exact precalculation of MP4-overhead is more difficult than for AVI. The overhead depends on the way how interleaving is done during the muxing, the amount of keysamples etc. Also there are many tables involved in a MPEG-4 files. Some of those tables are optional.
To "generate" a rule of thumb you may mux a MP4-file with one sample, measure the size of the "moov" atom, then afterwards mux a MP4-file with n seconds and calculate some ratio. As said, this will be very rough....

-mediator

bond
25th January 2006, 18:57
try megui

Inventive Software
25th January 2006, 21:05
With all due respect bond, I like to do the calcs myself. This is how I get the AVI overhead, and thus a target bitrate and file size for the video. I can then see where I'm going wrong, and how things work that way.

@mediator: Hadn't thought of that. Will give it a go later. I can mux an MP3 track in an AVI container, mux the same MP3 track in an MP4 container, and see what the difference is.

By the way, as a rule of thumb, for both AVI and MP4 I use 0.5 second interleaving.