Table of Contents

Enum H264Level

Namespace
VisioForge.Core.Types.FFMPEGEXE
Assembly
VisioForge.Core.dll

H.264 profile levels for FFMPEG encoding, defining decoder capability requirements.

public enum H264Level

Fields

None = 0

No level constraint - encoder decides based on content.

When set to None, FFMPEG will:

  • Analyze the input video parameters
  • Calculate minimum required level
  • Set level automatically in the bitstream

This is useful when:

  • You don't have specific device requirements
  • Maximum compatibility isn't critical
  • You want optimal quality without constraints

FFMPEG: Omit -level parameter or use -level 0

Level1 = 10

Level 1.0 - Minimal mobile video (176x144 @ 15fps, 64 kbps).

Constraints:

  • Max resolution: 176x144 (QCIF)
  • Max fps: 15
  • Max bitrate: 64 kbps
  • Max refs: ~4 frames

FFMPEG validation: -level 1 or -level 10 Use case: Legacy mobile devices, minimal bandwidth

Level11 = 11

Level 1.1 - Basic mobile video (176x144 @ 30fps, 192 kbps).

Constraints:

  • Max resolution: 352x288 @ 7.5fps or 176x144 @ 30fps
  • Max bitrate: 192 kbps
  • Max refs: ~9 frames

FFMPEG: -level 1.1 or -level 11 Common: 3G video calls, MMS video

Level12 = 12

1.2.

Level13 = 13

1.3.

Level2 = 20

2.0.

Level21 = 21

2.1.

Level22 = 22

2.2.

Level3 = 30

3.0.

Level31 = 31

Level 3.1 - HD 720p (1280x720 @ 30fps, 14 Mbps).

Constraints:

  • Max resolution: 1280x720 @ 30fps
  • Max bitrate: 14 Mbps
  • Max refs: 5 frames
  • DPB size: 8,192 KB

FFMPEG: -level 3.1 or -level 31

This is the most common level for HD streaming:

  • YouTube 720p
  • Twitch streaming
  • Apple TV+
  • Most smart TVs support this level
Level32 = 32

3.2.

Level4 = 40

Level 4.0 - Full HD 1080p (1920x1080 @ 30fps, 20 Mbps).

Constraints:

  • Max resolution: 1920x1080 @ 30fps or 2048x1024 @ 30fps
  • Max bitrate: 20 Mbps
  • Max refs: 4 frames
  • DPB size: 10,368 KB

FFMPEG: -level 4 or -level 40

Standard for:

  • Full HD broadcasts
  • Netflix HD streaming
  • Professional video
  • Some Blu-ray content
Level41 = 41

Level 4.1 - Full HD with higher bitrate (1920x1080 @ 30fps, 50 Mbps).

Constraints:

  • Max resolution: 1920x1080 @ 30fps
  • Max bitrate: 50 Mbps
  • Max refs: 4 frames
  • DPB size: 10,368 KB

FFMPEG: -level 4.1 or -level 41

Industry standard for:

  • Blu-ray discs (must use 4.1)
  • High-quality streaming
  • Professional delivery
  • Most devices max out at 4.1 support

This is the safest choice for maximum compatibility with Full HD content.

Level42 = 42

Level 4.2 - Full HD 60fps (1920x1080 @ 60fps, 50 Mbps).

Constraints:

  • Max resolution: 1920x1080 @ 64fps
  • Max bitrate: 50 Mbps
  • Max refs: 4 frames

FFMPEG: -level 4.2 or -level 42

Use cases:

  • 60fps gaming streams
  • Sports broadcasts
  • High frame rate content

Note: Not all devices support 1080p60 playback

Level5 = 50

5.0.

Level51 = 51

Level 5.1 - 4K video support (4096x2304 @ 30fps, 240 Mbps).

Constraints:

  • Max resolution: 4096x2304 @ 30fps
  • Max bitrate: 240 Mbps
  • Max refs: 5 frames
  • DPB size: 110,400 KB

FFMPEG: -level 5.1 or -level 51

Required for:

  • 4K streaming services
  • Ultra HD content
  • Cinema production

Note: H.265/HEVC is more common for 4K content due to better compression efficiency.

Remarks

H.264 levels define maximum values for:

  • Video resolution (macroblocks)
  • Frame rate (macroblocks per second)
  • Bitrate and CPB buffer size
  • Number of reference frames
  • Video format parameters

Level selection ensures compatibility with target devices and networks. FFMPEG automatically validates that encoding parameters don't exceed the specified level's constraints.

Common FFMPEG usage:

  • Software: -c:v libx264 -level 4.1
  • NVIDIA: -c:v h264_nvenc -level 4.1
  • AMD: -c:v h264_amf -level 4.1
  • Intel: -c:v h264_qsv -level 4.1

The numeric values (10, 11, etc.) correspond to the level_idc values in the H.264 specification, which are written to the SPS NAL unit.