ENPTES Free trial

H.264 profiles and levels

Two fields of the encoder that decide which devices can play the video.

Short answer

In H.264, the profile defines which coding tools the stream may use, and the level sets the ceiling for frame size, frames per second and bitrate. A decoder declares the profile and the level it supports, and a stream above either one may not play. In streaming, the profiles are Baseline, Main and High, and the level follows from the resolution and the frame rate: 1080p at 30 frames fits level 4, and 1080p at 60 frames needs level 4.2.

The main screen of NWK Live Production with Preview, Program and the status bar at the bottom
The main screen of NWK Live Production with Preview, Program and the status bar at the bottom
On this page
  1. What a profile is
  2. What a level is
  3. The math: which level a format needs
  4. Where profiles and levels appear in practice
  5. Common confusions
  6. Related questions

What a profile is

H.264 has many compression tools, and not every device implements all of them. A profile is a defined subset of those tools. The stream states its profile, and a decoder that supports that profile is able to play the stream.

ProfileWhat the standard allows
BaselineI and P frames only, the simpler entropy coding (CAVLC), progressive pictures only
MainAdds B frames, the more efficient entropy coding (CABAC) and interlaced video
HighAdds the 8 × 8 transform. 8 bits, 4:2:0
High 10High with up to 10 bits
High 4:2:2High 10 with 4:2:2 chroma

More tools mean a better picture at the same bitrate and more work to decode. Frame types are explained in I-frames, P-frames, B-frames and the GOP.

What a level is

A level is a set of limits. The same levels are used with every profile. H.264 counts in macroblocks, blocks of 16 × 16 pixels, and each level limits how many macroblocks a frame may have and how many the decoder must process per second.

LevelMacroblocks per frameMacroblocks per secondMaximum video bitrate (Baseline and Main)
3.13,600108,00014,000 kbps
3.25,120216,00020,000 kbps
48,192245,76020,000 kbps
4.18,192245,76050,000 kbps
4.28,704522,24050,000 kbps
5.136,864983,040240,000 kbps

In the High profile the bitrate ceiling is 1.25 times the value in the table: 25,000 kbps at level 4 and 62,500 kbps at level 4.1. Levels 4 and 4.1 have the same frame size and frame rate limits and differ in the bitrate ceiling.

The math: which level a format needs

  • 720p: 1280 ÷ 16 = 80 and 720 ÷ 16 = 45, so 80 × 45 = 3,600 macroblocks. At 30 frames, 3,600 × 30 = 108,000 per second: level 3.1. At 60 frames, 216,000 per second: level 3.2.
  • 1080p: 1920 ÷ 16 = 120 and 1080 ÷ 16 = 67.5, rounded up to 68, so 120 × 68 = 8,160 macroblocks. At 30 frames, 8,160 × 30 = 244,800 per second: level 4. At 60 frames, 489,600 per second: above level 4.1 and within level 4.2.
  • 2160p (4K): 3840 ÷ 16 = 240 and 2160 ÷ 16 = 135, so 240 × 135 = 32,400 macroblocks. At 30 frames, 972,000 per second: level 5.1. At 60 frames, 1,944,000 per second, which needs a level above 5.1, added in later editions of the standard.

Where profiles and levels appear in practice

  • In the encoder. Many encoders have a profile field and a level field, often with an automatic option that picks the level from the resolution and the frame rate.
  • In platform requirements. Each platform publishes what its ingestion accepts. Follow the page of the platform.
  • In the player. Older phones, televisions and set-top boxes decode up to a certain profile and level. A stream above that shows a black picture or an error.
  • In error messages. Raising a 1080p stream from 30 to 60 frames with the level fixed at 4.1 puts the stream out of the level.

High is the usual choice for streaming, because current devices decode it and it compresses better than Baseline. Baseline remains for very old devices and for some real-time video systems.

Common confusions

  • A higher level does not improve the picture. The level is a ceiling. Quality comes from the bitrate and from the encoder settings. See CBR or VBR for streaming.
  • The profile is not the encoder preset. The preset trades encoding speed for efficiency. The profile says which tools may be used.
  • The level is not the bitrate. The level only limits how high the bitrate can go.
  • H.264 levels are not HEVC levels. HEVC has its own profiles and its own level table. The numbers do not carry over.
  • Profile and level are not the container. MP4 and MOV hold the stream and do not change the profile. See Codec and container: H.264 is not MP4.

Related questions

Which H.264 profile should I use for live streaming?

Use High, unless the platform or the device that will play the stream asks for another profile. High gives a better picture than Main or Baseline at the same bitrate and is decoded by current phones, computers and televisions.

Which H.264 level does 1080p60 need?

Level 4.2. A 1080p frame has 8,160 macroblocks, and at 60 frames per second the decoder has to process 489,600 macroblocks per second. Levels 4 and 4.1 stop at 245,760 per second, and level 4.2 goes up to 522,240.

Does a higher level give better quality?

No. The level is a limit on frame size, frame rate and bitrate. Setting a level higher than the stream needs changes nothing in the picture and can make the stream fail on devices that do not support that level.

In the NWK help center

Sources and references

Written and reviewed by the NWK Live Production team (Setor 360 Tecnologia e Eventos Ltda). Published .

NWK streams in H.264 with AAC audio, and each destination has its own resolution, frame rate and bitrate.

Try NWK free for 7 days