Class MFH264EncoderSettings
- Assembly
- VisioForge.Core.dll
Media Foundation H264 encoder (mfh264enc) settings. Uses the MFT runtime, which keeps a per-adapter session counter independent of AMF/NVENC. Use it as a fallback when VisioForge.Core.Types.X.VideoEncoders.AMFH264EncoderSettings exhausts its session cap on AMD adapters, or when a specific AMD/Intel MFT device is preferred.
public class MFH264EncoderSettings : IH264EncoderSettings, IVideoEncoder, IMediaBlockSettings, IEncoderTextInfoInheritance
Implements
Inherited Members
Constructors
MFH264EncoderSettings(int)
Initializes a new instance of the VisioForge.Core.Types.X.VideoEncoders.MFH264EncoderSettings class with the given device id. Use 0 (default) unless you need a specific MFT instance.
public MFH264EncoderSettings(int id)Parameters
idint
MFH264EncoderSettings()
Initializes a new instance of the VisioForge.Core.Types.X.VideoEncoders.MFH264EncoderSettings class on the default MF H264 encoder.
public MFH264EncoderSettings()Fields
Name
The display name of this encoder family.
public const string Name = "MF H264"Field Value
Properties
BFrames
Gets or sets B-frame count.
public uint BFrames { get; set; }Property Value
Bitrate
Gets or sets target bitrate in Kbit/s.
public uint Bitrate { get; set; }Property Value
DeviceID
Gets the device identifier chosen at construction. 0 = default MF H264 encoder.
public int DeviceID { get; }Property Value
GOPSize
Gets or sets GOP size (frames). -1 = MFT default.
public int GOPSize { get; set; }Property Value
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
LowLatency
Gets or sets low-latency mode.
public bool LowLatency { get; set; }Property Value
MaxBitrate
Gets or sets maximum bitrate applied in VBR/QVBR modes.
public uint MaxBitrate { get; set; }Property Value
NumOfReferenceFrames
Gets or sets the number of reference frames. 0 = MFT default.
public uint NumOfReferenceFrames { get; set; }Property Value
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
Profile
Gets or sets the H.264 profile requested via output caps.
public MFH264EncoderProfile Profile { get; set; }Property Value
QP
Gets or sets the QP applied in QVBR mode.
public uint QP { get; set; }Property Value
QPB
Gets or sets QP for B frames.
public uint QPB { get; set; }Property Value
QPI
Gets or sets QP for I frames.
public uint QPI { get; set; }Property Value
QPP
Gets or sets QP for P frames.
public uint QPP { get; set; }Property Value
QualityVSSpeed
Gets or sets quality-vs-speed tradeoff (0-100).
public uint QualityVSSpeed { get; set; }Property Value
RateControl
Gets or sets rate control mode.
public MFH264EncoderRCMode RateControl { get; set; }Property Value
VBVBufferSize
Gets or sets VBV buffer size. 0 = MFT default.
public uint VBVBufferSize { get; set; }Property Value
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
GetDeviceCache()
Gets a snapshot of the device cache. Triggers enumeration on first access. Returns a read-only copy so callers cannot mutate the shared cache.
public static IReadOnlyList<Tuple<int, string, string>> GetDeviceCache()Returns
GetDeviceIDs()
Enumerates available Media Foundation H264 encoder device ids. Skips NVENC-flagged MFTs (those are handled through nvh264enc/NVENCH264EncoderSettings).
public static List<Tuple<int, string>> GetDeviceIDs()Returns
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
IsAvailable()
Determines whether a Media Foundation H264 encoder is available.
public static bool IsAvailable()Returns
ToString()
Returns a string that represents the current object.
public override string ToString()Returns
- string
-
A string that represents the current object.