Table of Contents

Enum H264MFScenario

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

H264 Media Foundation usage scenario.

public enum H264MFScenario

Fields

Default = -1

Default scenario

Uses balanced encoder settings suitable for general-purpose video encoding. The encoder makes no specific optimizations, using standard defaults for all parameters.

Characteristics:

  • Moderate GOP size (typically 60-120 frames)
  • Standard motion estimation and reference frames
  • Balanced quality vs. performance trade-offs
  • B-frames enabled for better compression

FFMPEG usage: -scenario default (or omit -scenario option)

Use when:

  • No specific requirements exist
  • Encoding general video content
  • Unsure which scenario to choose
  • Need predictable, well-tested behavior
DisplayRemoting = 1

Display remoting.

Optimized for screen capture and remote desktop scenarios where screen content is being transmitted with minimal latency. Prioritizes text clarity and UI responsiveness.

Optimizations:

  • Very low latency (minimal buffering)
  • Optimized for screen content (text, UI elements)
  • Reduced motion estimation for static areas
  • Smaller GOP size for quick updates
  • Intra-refresh for error resilience

FFMPEG usage: -scenario displayremoting Example: ffmpeg -f gdigrab -i desktop -c:v h264_mf -scenario displayremoting output.mp4

Technical details:

  • Typically disables B-frames
  • Uses specialized screen content coding tools
  • May enable palette mode for better compression
  • Prioritizes latency over compression ratio

Ideal for:

  • Remote Desktop Protocol (RDP) alternatives
  • Screen sharing applications
  • Software demonstrations
  • Virtual desktop infrastructure (VDI)
VideoConference = 2

Video conference.

Optimized for real-time bidirectional video communication with ultra-low latency. Prioritizes consistent frame delivery and minimal delay over compression efficiency.

Optimizations:

  • Ultra-low latency (< 100ms end-to-end possible)
  • No B-frames (reduces delay)
  • Small GOP size (typically 30-60 frames)
  • Fast motion estimation
  • Error resilience features enabled
  • Consistent frame timing

FFMPEG usage: -scenario videoconference Example: ffmpeg -f dshow -i video="Webcam" -c:v h264_mf -scenario videoconference -f rtp rtp://

Rate control behavior:

  • Prefers CBR or constrained VBR
  • Quick adaptation to bandwidth changes
  • Smooth quality transitions
  • Prevents quality fluctuations

Perfect for:

  • Video calling applications
  • WebRTC implementations
  • Live interviews
  • Telemedicine applications
Archive = 3

Archive.

Optimized for maximum quality when encoding for long-term storage. Prioritizes compression efficiency and visual quality over encoding speed or latency.

Optimizations:

  • Maximum quality settings
  • Large GOP size (120-300 frames)
  • Multiple reference frames
  • Advanced motion estimation
  • All compression tools enabled
  • No latency constraints

FFMPEG usage: -scenario archive Example: ffmpeg -i source.mov -c:v h264_mf -scenario archive -b:v 10M master.mp4

Encoding characteristics:

  • Full B-frame pyramids
  • Extended motion search range
  • Adaptive quantization enabled
  • May use 2-pass encoding internally
  • Highest profile features (High/High10)

Best suited for:

  • Digital preservation
  • Master file creation
  • Blu-ray authoring sources
  • Professional video archives
  • Content that will be re-encoded
LiveStreaming = 4

Live streaming.

Balanced settings for live streaming to platforms like YouTube, Twitch, or Facebook. Optimizes for consistent quality with reasonable latency for live audiences.

Optimizations:

  • Moderate latency (1-3 seconds typical)
  • Consistent GOP structure for HLS/DASH
  • Stable bitrate (CBR or capped VBR)
  • IDR frames at segment boundaries
  • Some B-frames for efficiency

FFMPEG usage: -scenario livestreaming Example: ffmpeg -i input -c:v h264_mf -scenario livestreaming -f flv rtmp://server/live

Streaming-specific features:

  • 2-second GOP (48-60 frames)
  • Closed GOP for segmentation
  • VBV buffer optimized for streaming
  • Gradual quality changes
  • Network adaptation support

Recommended for:

  • Live event streaming
  • Gaming streams
  • Webinars
  • Live sports broadcasting
  • 24/7 streaming channels
CameraRecord = 5

Camera record.

Optimized for recording directly from camera sources, balancing file size with quality for typical camera recording scenarios like camcorders or surveillance systems.

Optimizations:

  • Moderate compression settings
  • Efficient storage usage
  • Real-time encoding capability
  • Scene change detection
  • Variable GOP based on motion

FFMPEG usage: -scenario camerarecord Example: ffmpeg -f dshow -i video="Camera" -c:v h264_mf -scenario camerarecord recording.mp4

Recording features:

  • Adaptive bitrate for storage efficiency
  • Motion-based quality allocation
  • Long recording stability
  • Gradual parameter changes
  • File recovery features

Typical applications:

  • Security camera recording
  • Dash cam recording
  • Body camera footage
  • Home video recording
  • Event documentation
DisplayRemotingWithFeatureMap = 6

Display remoting with feature map.

Advanced display remoting mode that uses feature maps to identify and optimize different screen regions (video, text, images) independently. Provides superior quality for mixed content scenarios.

Enhanced features:

  • Content-adaptive encoding regions
  • Separate optimization for text/video areas
  • Feature map generation and tracking
  • Selective refresh for changed regions
  • Higher quality for static UI elements

FFMPEG usage: -scenario displayremotingwithfeaturemap

Technical implementation:

  • Analyzes screen content types
  • Creates spatial feature maps
  • Applies region-specific encoding
  • Text areas: High quality, low motion
  • Video areas: Standard video encoding
  • Static areas: Minimal updates

Superior for:

  • Modern desktop sharing with mixed content
  • Presentations with embedded video
  • Software development streaming
  • CAD/3D application remoting

Note: Requires more GPU resources than standard display remoting. May not be supported on older GPU models.

Remarks

Defines predefined encoding scenarios that optimize Media Foundation encoder settings for specific use cases. These scenarios automatically configure multiple encoder parameters including GOP structure, latency settings, quality trade-offs, and rate control behavior to match common video encoding requirements.

When using FFMPEG with the h264_mf codec, scenarios are specified using the -scenario option: ffmpeg -i input.mp4 -c:v h264_mf -scenario displayremoting output.mp4

Each scenario represents a collection of optimizations that would otherwise require multiple manual parameter adjustments. The actual optimizations vary by GPU vendor and driver version but generally follow consistent patterns.