Table of Contents

Class IBasicVideoSettings

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

Defines the interface for basic video encoding settings used by FFMPEG executable operations.

public class IBasicVideoSettings

Inheritance

Derived

Inherited Members

Remarks

This class provides the fundamental video encoding parameters required for most video processing and encoding scenarios. It serves as the base configuration for video streams and supports a wide range of encoding options from basic resize operations to advanced codec-specific settings.

Key encoding parameters include resolution, bitrate, aspect ratio, encoder selection, and quality settings. Proper configuration of these parameters ensures optimal balance between file size, quality, and compatibility.

Properties

AspectRatioH

Gets or sets the aspect ratio height component. Set to 0 to use calculated or default value.

public int AspectRatioH { get; set; }

Property Value

int

Remarks

Specifies the height component of the Display Aspect Ratio (DAR). Must be set together with AspectRatioW to define a custom aspect ratio.

The aspect ratio affects how the video appears on playback. Players use this metadata to correctly scale the video to fill the display without distortion, adding letterboxing if necessary.

AspectRatioW

Gets or sets the aspect ratio width component. Set to 0 to use calculated or default value.

public int AspectRatioW { get; set; }

Property Value

int

Remarks

Specifies the width component of the Display Aspect Ratio (DAR). Combined with AspectRatioH, this defines the aspect ratio independent of pixel dimensions. The SAR (Sample/Storage Aspect Ratio) is calculated from the relationship between DAR and pixel dimensions.

Common aspect ratios: - 4:3 (AspectRatioW=4, AspectRatioH=3): Traditional TV, iPad - 16:9 (AspectRatioW=16, AspectRatioH=9): Modern TV, YouTube, most video - 16:10 (AspectRatioW=16, AspectRatioH=10): Some computer monitors - 21:9 (AspectRatioW=21, AspectRatioH=9): Ultrawide cinema - 1:1 (AspectRatioW=1, AspectRatioH=1): Square (Instagram, profile videos) - 9:16 (AspectRatioW=9, AspectRatioH=16): Vertical video (TikTok, Stories)

Setting to 0:0 (both values 0) uses the aspect ratio derived from Width and Height, or preserves the source aspect ratio if dimensions aren't specified.

BasicMode

Gets or sets the basic encoding mode when not using codec-specific settings.

public VideoMode BasicMode { get; set; }

Property Value

VideoMode

Remarks

BasicMode provides a simplified rate control interface when codec-specific settings classes are not used. This parameter may be ignored if the encoder has a dedicated settings class (e.g., H264MFSettings, X264Settings).

Common modes: - CBR (Constant Bitrate): Fixed bitrate, variable quality - ABR (Average Bitrate): Balanced approach - Quality/VBR: Best quality-to-size ratio - Lossless: Perfect quality, large files

See VisioForge.Core.Types.FFMPEGEXE.VideoMode for detailed information about each mode and when to use it.

Bitrate

Gets or sets the target video bitrate in kilobits per second (kbps).

public int Bitrate { get; set; }

Property Value

int

Remarks

Bitrate is the primary quality control parameter for most encoding modes. Higher bitrates provide better quality but larger file sizes. The optimal bitrate depends on resolution, frame rate, content complexity, and codec.

Recommended bitrates for H.264/H.265 by resolution (kbps):

H.264 recommendations (typical scenes, 30fps): - 480p (854x480): 1000-1500 kbps - 720p (1280x720): 2500-5000 kbps - 1080p (1920x1080): 5000-8000 kbps - 1440p (2560x1440): 10000-16000 kbps - 4K (3840x2160): 35000-45000 kbps

H.265/HEVC (approximately 40-50% lower than H.264): - 720p: 1500-3000 kbps - 1080p: 3000-6000 kbps - 4K: 20000-30000 kbps

Content adjustments: - High motion (sports, action): +30-50% - Low motion (talking head, screencast): -20-40% - High detail (film grain, textures): +20-30% - Simple graphics: -30-50%

Platform-specific recommendations: - YouTube: Follow YouTube's recommended upload encoding settings - Twitch: 6000 kbps max (non-partnered) - Facebook: 4000 kbps max for 1080p - Instagram: 3500 kbps for feed, 2000 kbps for stories

Encoder

Gets or sets the video encoder (codec) to use for encoding.

public VideoEncoder Encoder { get; set; }

Property Value

VideoEncoder

Remarks

The encoder determines the compression algorithm and features available for video encoding. Different encoders offer different trade-offs between quality, encoding speed, file size, hardware requirements, and compatibility.

Encoder selection considerations: - Target platform compatibility - Quality and compression efficiency needs - Encoding speed requirements - Hardware acceleration availability - License and patent considerations

See VisioForge.Core.Types.FFMPEGEXE.VideoEncoder for detailed information about available codecs, their characteristics, hardware requirements, and recommended use cases.

Height

Gets or sets the output video height in pixels.

public int Height { get; set; }

Property Value

int

Remarks

Specifies the vertical resolution of the output video. When set to 0, the encoder will preserve the source video height. Height must be positive and typically should be even numbers.

When both Width and Height are 0, the source dimensions are preserved. When only one dimension is set, the other can be calculated to maintain aspect ratio, though explicit setting of both values is recommended.

Interlace

Gets or sets a value indicating whether the output video should be interlaced.

public bool Interlace { get; set; }

Property Value

bool

Remarks

Interlaced video splits each frame into two fields (odd and even scan lines) that are captured and displayed at different times. Modern content is typically progressive scan (all lines at once), but interlaced is still used in some broadcast scenarios.

Interlaced formats: - 1080i: 1920x1080 interlaced (used in broadcasting) - 576i: PAL interlaced (Europe) - 480i: NTSC interlaced (North America)

When to use interlaced: - Broadcasting to traditional TV systems - Compatibility with legacy equipment - Specific broadcast requirements - Source material is interlaced

When to use progressive (false): - Web streaming and online video - Modern display devices - Computer monitors - Mobile devices - Film and cinema content

Note: Most modern applications should use progressive scan (false). If source is interlaced, consider deinterlacing before encoding.

Letterbox

Gets or sets a value indicating whether letterboxing should be applied during resize.

public bool Letterbox { get; set; }

Property Value

bool

Remarks

When true and the source aspect ratio doesn't match the target aspect ratio, black bars (letterbox/pillarbox) are added to preserve the original aspect ratio without distortion. When false, the video is stretched/squeezed to fill the target dimensions.

Letterboxing behavior: - Horizontal bars (top/bottom): Letterbox (wide source to narrow target) - Vertical bars (left/right): Pillarbox (narrow source to wide target)

Use letterboxing when: - Preserving original aspect ratio is critical - Converting between 4:3 and 16:9 - Encoding for display devices with fixed aspect ratios

Avoid letterboxing when: - Target device can adjust aspect ratio - Maximum image area is desired - Slight distortion is acceptable

MaxBitrate

Gets or sets the maximum video bitrate in kilobits per second (kbps).

public int MaxBitrate { get; set; }

Property Value

int

Remarks

MaxBitrate sets an upper limit on bitrate for Variable Bitrate (VBR) encoding modes or rate control. The encoder can vary bitrate up to this ceiling based on scene complexity. Used with a buffer size to prevent bitrate spikes that could cause buffering during streaming.

Typical relationship: - MaxBitrate = 1.5 to 2.0 × Target Bitrate - Example: Bitrate=5000, MaxBitrate=8000-10000

Use cases: - Streaming with bandwidth constraints - Adaptive bitrate streaming (HLS/DASH) - Network-delivered content - Preventing player buffer underruns

Note: Requires appropriate buffer size setting (typically 1-2 seconds worth of maximum bitrate) for proper operation. Setting too low can cause quality loss in complex scenes.

MinBitrate

Gets or sets the minimum video bitrate in kilobits per second (kbps).

public int MinBitrate { get; set; }

Property Value

int

Remarks

MinBitrate sets a lower limit on bitrate for Variable Bitrate (VBR) encoding modes. Ensures a minimum quality level even in very simple scenes. Less commonly used than MaxBitrate.

Typical relationship: - MinBitrate = 0.5 to 0.8 × Target Bitrate - Example: Bitrate=5000, MinBitrate=2500-4000

Use when: - Ensuring minimum quality floor - CBR-like behavior with some flexibility - Preventing aggressive quality reduction

Note: Setting MinBitrate = MaxBitrate = Target creates true Constant Bitrate (CBR) encoding, though this is inefficient for file-based storage and most streaming scenarios.

Quality

Gets or sets the quality level for quality-based encoding modes.

public int Quality { get; set; }

Property Value

int

Remarks

Quality parameter is used for quality-based encoding modes. The scale and interpretation vary by encoder and mode. This is often used with CRF (Constant Rate Factor) or similar quality-targeting modes.

Common quality scales:

x264/x265 CRF (lower is better quality): - 18: Visually lossless - 23: Default, good balance - 28: Acceptable for web content - 35+: Low quality, small files Range: 0-51 (0=lossless, 51=worst)

NVIDIA NVENC (lower is better): - 0: Automatic - 1-51: CRF-like scale

Note: Quality parameter interpretation is encoder-specific. When using dedicated settings classes (H264MFSettings, etc.), those classes may provide more detailed quality control options. Refer to specific encoder documentation for exact quality scale interpretation.

TVSystem

Gets or sets the TV system for broadcast-compatible encoding.

public TVSystem TVSystem { get; set; }

Property Value

TVSystem

Remarks

TV system specification is used when encoding for broadcast television or DVD/Blu-ray authoring. It defines frame rate, resolution standards, and color encoding specifications specific to regional broadcast systems.

For non-broadcast applications (web, streaming, general video), set to TVSystem.None and specify frame rate and resolution independently.

See VisioForge.Core.Types.FFMPEGEXE.IBasicVideoSettings.TVSystem for detailed information about PAL, NTSC, and Film standards.

Width

Gets or sets the output video width in pixels.

public int Width { get; set; }

Property Value

int

Remarks

Specifies the horizontal resolution of the output video. When set to 0, the encoder will preserve the source video width. Width must be positive and typically should be even numbers (required by many codecs).

Common resolutions: - 640x480: VGA (4:3) - 1280x720: HD Ready / 720p (16:9) - 1920x1080: Full HD / 1080p (16:9) - 2560x1440: QHD / 1440p (16:9) - 3840x2160: 4K UHD / 2160p (16:9) - 7680x4320: 8K UHD (16:9)

Note: Many codecs require even dimensions. For H.264/H.265, dimensions should ideally be divisible by 16 for optimal encoding efficiency.