Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The maximum size with bytes of one NAL unit

Tags:

h.264

I can't find any clue in H.264 spec, anybody can give a clear and simple maximum size regardless of its profile and level?

I'd like to parse H.264 stream, and copy one complete NAL unit buffer to a fixed-size buffer which can hold all bytes of one NAL unit.

Thanks.

like image 450
ravin.wang Avatar asked Dec 13 '25 17:12

ravin.wang


1 Answers

AVC level 6.2 allows up to 139264 macro blocks per frame. If we use 10 bit color 4:4:4 it’s 30 bits per pixel. So (30*139264*16*16)/8 gives about 133.7mbytes for an uncompressed image. H.264 has a PCM_I encoding that allows for uncompressed images. There is a little ovehead for the NAL header, so let’s call it 134Mbyte. But in the real world the frame probablly will not be this large, and will likely be compressed.

like image 112
szatmary Avatar answered Dec 16 '25 21:12

szatmary



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!