Table of Contents

Class D3D12H264EncoderSettings

Namespace
VisioForge.Core.Types.X.VideoEncoders
Assembly
VisioForge.Core.dll

D3D12 Video Encode H264 encoder (d3d12h264enc) settings. Uses the DirectX 12 Video Encode API — a third independent runtime next to AMF and Media Foundation, with its own per-adapter session counter. Requires GStreamer 1.24+ and a D3D12-capable GPU.

public class D3D12H264EncoderSettings : IH264EncoderSettings, IVideoEncoder, IMediaBlockSettings, IEncoderTextInfo

Inheritance

Implements

Inherited Members

Constructors

D3D12H264EncoderSettings()

Initializes a new instance of the VisioForge.Core.Types.X.VideoEncoders.D3D12H264EncoderSettings class.

public D3D12H264EncoderSettings()

Fields

Name

Display name.

public static readonly string Name

Field Value

string

Properties

Bitrate

Gets or sets target bitrate in Kbit/s.

public uint Bitrate { get; set; }

Property Value

uint

GOPSize

Gets or sets number of frames between key frames. -1 = driver default.

public int GOPSize { get; set; }

Property Value

int

H264ParseInferTimestamps

Gets or sets h264parse infer-ts setting. Defaults to true.

public bool? H264ParseInferTimestamps { get; set; }

Property Value

bool?

H264ParsePtsInterpolation

Gets or sets h264parse pts-interpolation setting. Defaults to true.

public bool? H264ParsePtsInterpolation { get; set; }

Property Value

bool?

KeyFrameDetected

Occurs when on key frame detected. Timestamp is in nanoseconds.

public KeyFrameDetectedDelegate KeyFrameDetected { get; set; }

Property Value

KeyFrameDetectedDelegate

MaxBitrate

Gets or sets maximum bitrate in Kbit/s (VBR modes).

public uint MaxBitrate { get; set; }

Property Value

uint

ParseStream

Gets or sets a value indicating whether to parse the video stream. True by default. Disable it for SRT streaming.

public bool ParseStream { get; set; }

Property Value

bool

Profile

Gets or sets the H.264 profile.

public D3D12H264EncoderProfile Profile { get; set; }

Property Value

D3D12H264EncoderProfile

QPB

Constant QP for B frames. Used when VisioForge.Core.Types.X.VideoEncoders.D3D12H264EncoderSettings.RateControl = CQP.

public uint QPB { get; set; }

Property Value

uint

QPI

Constant QP for I frames. Used when VisioForge.Core.Types.X.VideoEncoders.D3D12H264EncoderSettings.RateControl = CQP.

public uint QPI { get; set; }

Property Value

uint

QPInit

Initial QP used for CBR/VBR/QVBR rate control. Serialized as the qp-init property on d3d12h264enc (there is no bare qp property on this element). 0 means the encoder picks its own initial QP.

public uint QPInit { get; set; }

Property Value

uint

QPP

Constant QP for P frames. Used when VisioForge.Core.Types.X.VideoEncoders.D3D12H264EncoderSettings.RateControl = CQP.

public uint QPP { get; set; }

Property Value

uint

RateControl

Gets or sets the rate control mode. The underlying element's property name is rate-control. We pass the enum as-is; mapping matches d3d12h264enc.

public D3D12H264EncoderRateControl RateControl { get; set; }

Property Value

D3D12H264EncoderRateControl

Methods

CreateBlock()

Creates a new MediaBlock instance configured with the settings contained in this object. This factory method allows for separation of configuration from instantiation, making it easier to serialize settings or create multiple blocks with the same configuration.

public MediaBlock CreateBlock()

Returns

MediaBlock

A new MediaBlock instance configured according to this settings object.

GetCaps()

Retrieves a string representation of the encoder's capabilities (GStreamer caps). This string describes the media formats and properties that the encoder can handle.

public string GetCaps()

Returns

string

A String containing the encoder's capabilities.

GetEncoderType()

Gets the type of the encoder.

public H264EncoderType GetEncoderType()

Returns

H264EncoderType

H264EncoderType.

GetParameters()

Retrieves a string representation of the encoder's current parameters. This string typically includes settings like bitrate, resolution, frame rate, and other configured options.

public string GetParameters()

Returns

string

A String containing the encoder parameters.

IsAvailable()

Determines whether d3d12h264enc is available on the host.

public static bool IsAvailable()

Returns

bool

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.