H.264/AVC puts constraints on the maximal number of slices per picture. Generally speaking, the maximal slice number depends on the video resolution and the frame rate (more precisely on the level which is signaled in SPS).

For example, for 1080p60fps the maximal number slices per frame is 361. If your stream contains a frame with 363 slices then it’s not guaranteed that some “strict” players would not fail in decoding of your stream.

The AVC/H.264 spec. says:

In bitstreams conforming to the Main, High, Progressive High, Constrained High, High 10, High 4:2:2, High 4:4:4 Predictive, High 10 Intra, High 4:2:2 Intra, High 4:4:4 Intra, or CAVLC 4:4:4 Intra profiles, the difference between consecutive removal times of access units n and n − 1 with n > 0 shall satisfy the constraint that the number of slices in picture n is less than or equal to MaxMBPS * ( tr( n ) − tr( n − 1 ) ) ÷ SliceRate, where MaxMBPS and SliceRate are the values specified in Tables A-1 and A-4

Let’s calculate the maximal number of slices per picture for 1080p60:

What’s the minimal level for 1080p60? The answer is 4.2 . The maximal MB rate for 4.0 and 4.1 is  245,760 MB/s (according to Table A-1 of H.264/AVC spec.).  A 1080p60 frame has 8160 macroblocks per frame, with a total MB rate of  8160 * 60 fps = 489,600 MB/s, which is greater that the 245,760 MB/s. The maximal MB rate for 4.2 is 522,240 MB/s which is greater 489,600 MB/s.

So, the level of 1080p@60 is 4.2 (although the level can be higher but we consider 4.2). For the level 4.2 the value of MaxMBPS =  489,600 MB/s. (according to Table A-1 of H.264/AVC spec.) and SliceRate = 24 (according to Table A-4 of H.264/AVC spec.).  For 60fps tr( n ) − tr( n − 1 ) = 0.0166 seconds.

Hence, the maximal number of slices in 1080p frame is 361 slices  =  int(522240*0.166/24)

However, not all devices support the level 4.2. For example Fire TV Stick devices don’t support the level 4.2, according to the specification (https://developer.amazon.com/docs/fire-tv/device-specifications-fire-tv-stick.html):

H.264. Hardware accelerated up to 1080p @ 30fps or 720p @ 60fps, 20 Mbps, High Profile up to Level 4.

It’s worth mentioning that LibAV h264/avc decoder sets the maximal number of  slices per frame to 32 irrespective the resolution or the frame rate (look at the define MAX_SLICES in h264dec.h).

13 Responses

  1. Currently it looks like Drupal is the best blogging platform out there right now. (from what I’ve read) Is that what you’re using on your blog?

  2. Thank you for sharing superb informations. Your web site is very cool. I’m impressed by the details that you?¦ve on this blog. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for more articles. You, my pal, ROCK! I found simply the info I already searched all over the place and just couldn’t come across. What a great web-site.

  3. Throughout this grand design of things you actually get an A+ just for effort. Exactly where you actually confused everybody ended up being in all the specifics. You know, they say, details make or break the argument.. And it couldn’t be more correct right here. Having said that, let me tell you precisely what did deliver the results. The authoring is certainly extremely engaging and that is most likely the reason why I am making the effort in order to opine. I do not really make it a regular habit of doing that. Secondly, although I can certainly see a leaps in reasoning you come up with, I am not really convinced of exactly how you seem to connect the points which in turn produce the conclusion. For the moment I shall subscribe to your issue but wish in the future you link the facts much better.

  4. Thanx for the effort, keep up the good work Great work, I am going to start a small Blog Engine course work using your site I hope you enjoy blogging with the popular BlogEngine.net.Thethoughts you express are really awesome. Hope you will right some more posts.

Leave a Reply

Your email address will not be published. Required fields are marked *