Table of Contents

Class H264NVENCSettings

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

H264 NVENC settings.

public class H264NVENCSettings : CommonNVENCSettings

Inheritance

Inherited Members

Examples

// Configure for high-quality streaming
var streamSettings = new H264NVENCSettings
{
    Width = 1920,
    Height = 1080,
    Framerate = 60,
    Profile = H264NVENCProfile.High,
    Level = H264Level.Level42,
    Preset = NVENCPreset.LowLatencyHP,
    RateControl = NVENCRateControl.CBR,
    Bitrate = 6000,
    RCLookahead = 0,     // For low latency
    BAdapt = false,      // Disable for streaming
    A53CC = true         // Include closed captions
};

// Configure for maximum quality archival
var archiveSettings = new H264NVENCSettings
{
    Profile = H264NVENCProfile.High,
    Level = H264Level.Level51,
    Preset = NVENCPreset.P7,
    RateControl = NVENCRateControl.VBR,
    Bitrate = 20000,
    MaxBitrate = 40000,
    RCLookahead = 32,
    BRefMode = NVENCBRefMode.Middle,
    Coder = H264NVENCCoder.CABAC,
    SpatialAQ = true,
    TemporalAQ = true
};

Remarks

Provides comprehensive configuration for H.264/AVC encoding using NVIDIA NVENC hardware acceleration through FFMPEG. This class extends CommonNVENCSettings with H.264-specific options while leveraging NVIDIA GPU hardware for high-performance video encoding.

NVENC H.264 encoding offers:

  • Real-time encoding of multiple 4K streams (varies by GPU)
  • Minimal CPU usage (typically under 5%)
  • Low latency modes for streaming and gaming
  • Professional quality with hardware acceleration

Hardware requirements:

  • NVIDIA GeForce GTX 600 series or newer (Kepler architecture+)
  • NVIDIA drivers 378.66 or newer for full feature support
  • Windows 7 or newer (Linux also supported)

Session limits:

  • GeForce GPUs: 3 concurrent encoding sessions
  • Quadro/Tesla GPUs: Unlimited sessions

Constructors

H264NVENCSettings()

Initializes a new instance of the VisioForge.Core.Types.FFMPEGEXE.H264NVENCSettings class.

public H264NVENCSettings()

Remarks

Initializes with balanced defaults suitable for general-purpose encoding:

Video settings:

  • Encoder: H264_NVENC (NVIDIA hardware acceleration)
  • Resolution: 0x0 (maintains source resolution)
  • Aspect ratio: 0:0 (preserves source aspect)

Encoding parameters:

  • Profile: Main (broad compatibility)
  • Level: 5.0 (supports up to 4K30)
  • Rate Control: VBR (balanced quality/size)
  • Quality: 25 (similar to x264 CRF 23)
  • Coder: Default (CABAC for Main profile)

Features:

  • A53CC: Enabled (preserves closed captions)
  • Preset: Medium (from base class)
  • B-frames: Adaptive (from base class)

These defaults work well for most encoding scenarios. Adjust based on:

  • Target devices (may need lower level/profile)
  • Bandwidth constraints (switch to CBR)
  • Quality requirements (adjust quality value)
  • Latency needs (change preset and disable lookahead)

Properties

A53CC

Gets or sets a value indicating whether to use A53 Closed Captions (if available).

public bool A53CC { get; set; }

Property Value

bool

Remarks

Enables passthrough of CEA-608/708 closed caption data embedded in the video stream using ATSC A/53 standard. This preserves accessibility features when transcoding broadcast or streaming content.

FFMPEG mapping: -a53cc 1

How it works:

  • Extracts CC data from input stream
  • Embeds as SEI (Supplemental Enhancement Information) NAL units
  • Compatible with broadcast and streaming standards
  • No impact on video quality or bitrate

Use cases:

  • Broadcast television compliance
  • Streaming services with accessibility requirements
  • Preserving captions during transcoding
  • Legal compliance for public content

Requirements:

  • Input must contain CEA-608/708 caption data
  • Player must support A/53 caption extraction
  • May not work with all container formats

Note: This only passes through existing captions; it does not generate new captions or perform OCR on burned-in subtitles.

Coder

Gets or sets coder.

public H264NVENCCoder Coder { get; set; }

Property Value

H264NVENCCoder

Remarks

Specifies the entropy coding method used for final compression. CABAC provides better compression (10-15% smaller files) but requires more processing power to decode. CAVLC is simpler and required for Baseline profile.

FFMPEG mapping: -coder [auto|cabac|cavlc]

Recommendations:

  • Default/Auto: Let encoder choose based on profile
  • CABAC: Use for Main/High profiles for best compression
  • CAVLC: Required for Baseline, better for mobile

Note: Setting CABAC with Baseline profile will cause encoding to fail.

Level

Gets or sets level.

public H264Level Level { get; set; }

Property Value

H264Level

Remarks

The H.264 level defines maximum resolution, framerate, and bitrate combinations. It ensures decoder compatibility by limiting encoding complexity. Higher levels support larger resolutions and higher bitrates.

FFMPEG mapping: -level [1|1.1|1.2|...|5.1|5.2]

Common level requirements:

  • Level 3.0: 720p30 at 10 Mbps
  • Level 3.1: 720p60 or 1080p30 at 14 Mbps
  • Level 4.0: 1080p30 at 20 Mbps
  • Level 4.1: 1080p60 at 50 Mbps
  • Level 4.2: 1080p60 at 50 Mbps (higher macroblocks/sec)
  • Level 5.0: 4K30 at 135 Mbps
  • Level 5.1: 4K60 at 240 Mbps

Most devices support up to Level 4.1. Use Level 5+ only for 4K content or when targeting modern hardware with explicit 4K support.

Profile

Gets or sets profile.

public H264NVENCProfile Profile { get; set; }

Property Value

H264NVENCProfile

Remarks

The H.264 profile determines which encoding features are available and affects compatibility with playback devices. Higher profiles offer better compression but may not be supported by older devices.

Profile recommendations:

  • Baseline: Maximum compatibility, mobile devices
  • Main: Standard streaming and broadcast
  • High: Best quality for modern devices
  • High444p: Professional production only

FFMPEG mapping: -profile:v [baseline|main|high|high444p]

See H264NVENCProfile enum for detailed compatibility information.