User Tools

Site Tools


get_h264_level

This is an old revision of the document!


Get h264 level based on number of RefFrames

Number of reference frames is one of the most important indicators of H264 (avc) level. Devices usually fail to play videos with level > 4.1 (on a High profile).

Use this formula to work out dpbMbs value (more details see Wikipedia):

dpbMbs = (width * height * ref_frames) / 256

Where MaxDpbMbs is a constant value provided in the table below as a function of level number, and width and height are the picture width and frame height for the coded video data, expressed in pixels. This formula is specified in sections A.3.1.h and A.3.2.f of the 2009 edition of the standard.

Level 1 1b 1.1 1.2 1.3 2 2.1 2.2 3 3.1 3.2 4 4.1 4.2 5 5.1
MaxDpbMbs3963969002,3762,3762,3764,7528,1008,10018,00020,48032,76832,76834,816110,400184,320

Example

Below is MediaInfo output (stripped) of a video file.

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.1
Format settings, CABAC : Yes
Format settings, ReFrames : 12 frames
Format settings, GOP : N=1
Codec ID : V_MPEG4/ISO/AVC
Duration : 2h 23mn
Bit rate : 10.7 Mbps
Width : 1 920 pixels
Height : 800 pixels

Using the formula we get:

dpbMbs = (1920* 800 * 12 ) / 256 = 72000

This value falls into level 5 (which is different to what is actually in the AVC header (5.1) - that is often the case). This file would be rejected by most players as it has both levels, the header value (5.1) and RefFrame based (5), higher than the widely used max. level of 4.1.

get_h264_level.1322477231.txt.gz · Last modified: 2011/11/28 10:47 by zip