Log in

View Full Version : Need a good rule of thumb for container overhead calculation (MP4, MKV, and M2TS)


morphinapg
14th December 2008, 08:43
Not sure if this is the best place to post this or not.

I figured out why all my videos end up being slightly larger than ASXGui predicts them to be, it's because I' missing a calculation for container overhead.

I need figures for MP4, MKV and M2TS.

It doesn't need to be perfect (I know it can get quite complicated trying to figure it out) I just need a value that would be safe.

It would be something like

(video bitrate + audio bitrate) * length * x = total size

where x is the factor for container overhead. The bigger it is, the safer it would be (so if a user selects a target file size in ASXGui it won't go over) just not too big.

Selur
17th December 2008, 15:21
with m2ts X = 5 might be save even for small target sizes (for < 2hr files):
example I stumbled over:
37.502.976 Bytes inside container
8.472.672 Bytes raw
-> 29.030.304 Bytes overhead

=> don't think there's such a simple rule to get a hold of the overhead.
Yo probably need at least two more variables framecount, average framerate.
Then you could minimize the calculations in MeGui (mkv/mp4) and sx264 (m2ts) sourcecode and minimize them by taking always the worst case.

Cu Selur