Enum H264MFRateControl
- Namespace
- VisioForge.Core.Types.FFMPEGEXE
- Assembly
- VisioForge.Core.dll
FFMPEG EXE H264 Media Foundation encoder rate control.
public enum H264MFRateControlFields
CBR = 0-
CBR mode.
Constant Bitrate mode maintains a fixed bitrate throughout the encoding process. This mode is ideal for streaming scenarios where bandwidth is limited and predictable.
Characteristics:
- Maintains exact target bitrate with minimal variation
- Predictable file sizes and bandwidth usage
- May sacrifice quality in complex scenes to maintain bitrate
- Best for live streaming and video conferencing
FFMPEG usage: -rate_control cbr -b:v [bitrate] Example: -rate_control cbr -b:v 5M
Hardware considerations:
- Intel Quick Sync: Excellent CBR compliance
- NVIDIA NVENC: May show slight variations
- AMD VCE: Good compliance with proper buffer settings
PC_VBR = 1-
Peak constrained VBR mode.
Variable Bitrate with peak constraint allows quality-based encoding while ensuring the bitrate never exceeds a specified maximum. This balances quality with bandwidth limits.
Characteristics:
- Varies bitrate based on content complexity
- Hard limit on maximum bitrate for compatibility
- Better quality than CBR for same average bitrate
- Suitable for streaming with bandwidth constraints
FFMPEG usage: -rate_control pc_vbr -b:v [average] -maxrate [peak] Example: -rate_control pc_vbr -b:v 5M -maxrate 7M
Use cases:
- VOD streaming platforms with bandwidth limits
- Broadcast applications with transport stream constraints
- Storage-conscious encoding with quality priorities
U_VBR = 2-
Unconstrained VBR mode.
Unconstrained Variable Bitrate mode allows the encoder complete freedom to allocate bits based on content complexity without any upper limit constraints.
Characteristics:
- Maximum quality preservation
- Bitrate spikes during complex scenes
- Unpredictable bandwidth requirements
- Best for local storage and archival
FFMPEG usage: -rate_control u_vbr -b:v [average] Example: -rate_control u_vbr -b:v 8M
Ideal for:
- High-quality master files
- Content with varying complexity (action films)
- Scenarios where bandwidth is not a concern
Note: May produce very high bitrate spikes that can cause playback issues on bandwidth-limited devices.
Quality = 3-
Quality mode.
Constant Quality mode (similar to CRF in x264) maintains consistent visual quality throughout the video regardless of bitrate requirements. Quality level is specified instead of bitrate.
Characteristics:
- Consistent perceptual quality across all frames
- Highly variable bitrate based on complexity
- Excellent for archival and high-quality encoding
- File size unpredictable
FFMPEG usage: -rate_control quality -q:v [quality_level] Example: -rate_control quality -q:v 23
Quality scale:
- 1-18: Visually lossless to excellent
- 19-23: High quality (recommended)
- 24-28: Good quality
- 29-35: Acceptable quality
- 36+: Lower quality
Hardware notes:
- Implementation varies between GPU vendors
- Intel Quick Sync: Good quality consistency
- Results may differ from software encoders
LD_VBR = 4-
Low delay VBR mode.
Low Delay Variable Bitrate mode optimizes for minimal encoding latency while maintaining VBR benefits. Designed for real-time applications.
Characteristics:
- Reduced lookahead and buffering
- Faster encoding decisions
- Slightly lower compression efficiency
- Sub-frame latency possible
FFMPEG usage: -rate_control ld_vbr -b:v [bitrate] Example: -rate_control ld_vbr -b:v 4M
Optimizations:
- Minimal frame reordering
- Reduced reference frame buffer
- Simplified motion estimation
- No B-frames in most implementations
Perfect for:
- Live streaming with low latency requirements
- Video conferencing
- Cloud gaming
- Remote desktop applications
G_VBR = 5-
Global VBR mode.
Global Variable Bitrate mode uses extended lookahead to optimize bitrate allocation across larger segments or the entire video. This provides superior compression efficiency.
Characteristics:
- Analyzes content across multiple GOPs
- Optimal bit distribution for entire video
- Requires multi-pass analysis
- Higher memory usage and latency
FFMPEG usage: -rate_control g_vbr -b:v [average] Example: -rate_control g_vbr -b:v 6M
Benefits:
- 10-20% better compression than standard VBR
- Consistent quality across scene changes
- Ideal for VOD content
Requirements:
- Not suitable for live encoding
- Requires sufficient GPU memory for lookahead
- May not be supported on all GPU models
GLD_VBR = 6-
Global low delay VBR mode.
Combines global VBR optimization with low-delay constraints for balanced performance. This mode attempts to achieve better compression than LD_VBR while maintaining reasonable latency.
Characteristics:
- Limited lookahead (typically 1-2 GOPs)
- Better quality than standard LD_VBR
- Higher latency than pure low-delay modes
- Compromise between quality and latency
FFMPEG usage: -rate_control gld_vbr -b:v [bitrate] Example: -rate_control gld_vbr -b:v 5M
Use cases:
- Streaming with 1-2 second latency tolerance
- High-quality broadcasts
- Professional streaming productions
Hardware support:
- Requires newer GPU generations
- Intel Quick Sync: 6th gen Core or newer
- NVIDIA: GTX 1000 series or newer
- AMD: RX 400 series or newer
Remarks
Defines rate control modes available for H.264 encoding through Microsoft Media Foundation when using FFMPEG. Media Foundation provides hardware-accelerated encoding on Windows using Intel Quick Sync Video, AMD VCE, or NVIDIA NVENC, depending on available hardware.
These rate control modes determine how the encoder allocates bits across frames to achieve target bitrate or quality objectives. The choice of rate control mode significantly impacts both video quality and file size/streaming compatibility.
In FFMPEG, these modes are specified using the -rate_control option when using h264_mf codec: ffmpeg -i input.mp4 -c:v h264_mf -rate_control cbr -b:v 5M output.mp4