Class H264MFSettings
- Namespace
- VisioForge.Core.Types.FFMPEGEXE
- Assembly
- VisioForge.Core.dll
H264 Media Foundation settings.
public class H264MFSettings : CommonMFSettingsInheritance
Inherited Members
Examples
// Configure for high-quality streaming
var h264Settings = new H264MFSettings
{
Width = 1920,
Height = 1080,
Framerate = 30,
RateControl = H264MFRateControl.CBR,
Bitrate = 5000, // 5 Mbps
Scenario = H264MFScenario.LiveStreaming,
ForceHWEncoding = true // Ensure hardware acceleration
};
// Configure for archival with quality priority
var archiveSettings = new H264MFSettings
{
RateControl = H264MFRateControl.Quality,
Quality = 20, // High quality (lower = better)
Scenario = H264MFScenario.Archive
};
Remarks
Provides configuration for H.264/AVC encoding using Microsoft Media Foundation through FFMPEG. This class inherits from CommonMFSettings and provides H.264-specific initialization with sensible defaults for quality-based encoding.
Media Foundation H.264 encoding leverages hardware acceleration available on Windows systems:
- Intel Quick Sync Video (QSV) on Intel processors with integrated graphics
- NVIDIA NVENC on NVIDIA GPUs (through Media Foundation wrapper)
- AMD VCE/VCN on AMD GPUs
The encoder selection is automatic based on available hardware, with fallback to software encoding if no hardware encoder is available (unless ForceHWEncoding is set to true).
Constructors
H264MFSettings()
Initializes a new instance of the VisioForge.Core.Types.FFMPEGEXE.H264MFSettings class.
public H264MFSettings()Remarks
Sets default values optimized for real-time recording:
- Encoder: H264_MF (Media Foundation H.264)
- Rate Control: CBR (constant bitrate for real-time encoding)
- Bitrate: 10000000 bps (10 Mbps - good quality for 1080p)
- Scenario: LiveStreaming (good balance of quality and latency)
- Resolution: 0x0 (uses input resolution)
- Aspect Ratio: 0:0 (preserves source aspect ratio)
These defaults provide good results for real-time recording. For specific use cases, adjust the settings after initialization:
- Lower latency: Set Scenario to DisplayRemoting or VideoConference
- Archive quality: Change RateControl to Quality, set Quality to 18-22
- Lower bitrate: Reduce Bitrate to 4000000-6000000 for acceptable quality
- 4K recording: Increase Bitrate to 20000000-30000000