Table of Contents

Class BoxVideoEffect

Namespace
VisioForge.Core.Types.X.VideoEffects
Assembly
VisioForge.Core.dll

Represents a box effect that adds borders/padding or crops video with flexible fill options.

public class BoxVideoEffect : BaseVideoEffect, IBaseVideoEffect, IVideoEditXVideoEffect

Inheritance

Implements

Inherited Members

Remarks

SDK Availability: VideoCaptureCoreX, MediaPlayerCoreX, VideoEditCoreX, Media Blocks SDK

Platform Support: Windows, Linux, macOS, Android, iOS

The box effect is a versatile tool that can both crop (positive values) and add borders/padding (negative values) to video frames. It supports multiple fill modes for added borders including solid colors, transparency, and pattern fills. The effect can automatically center content when adding borders.

Operation Modes:

  • Positive Values: Crop pixels from edges (same as CropVideoEffect)
  • Negative Values: Add padding/borders around video
  • Mixed Values: Crop some edges while adding padding to others

Fill Modes:

  • Black: Solid black borders (most common)
  • White: Solid white borders
  • Green: Green screen background for compositing
  • Blue: Blue screen background for compositing
  • Red: Red background

Common Use Cases:

  • Adding letterboxing (black bars) to maintain aspect ratio
  • Creating pillarboxing for vertical to horizontal conversion
  • Adding colored borders for artistic effect
  • Preparing video for compositing (green/blue borders)
  • Standardizing video dimensions by adding padding

For Classic SDK, similar functionality available through output format padding settings. For simple cropping without padding, see VisioForge.Core.Types.X.VideoEffects.CropVideoEffect.

Performance Note: Adding padding is more efficient than cropping as it only extends the frame buffer. Transparent fills are slightly more expensive than solid colors.

Constructors

BoxVideoEffect(int, int, int, int)

Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.BoxVideoEffect class.

public BoxVideoEffect(int left, int top, int right, int bottom)

Parameters

left int

The pixels to crop at left. Positive values will crop, negative values will pad.

top int

The pixels to crop at top. Positive values will crop, negative values will pad.

right int

The pixels to crop at right. Positive values will crop, negative values will pad.

bottom int

The pixels to crop at bottom. Positive values will crop, negative values will pad.

Fields

DefaultName

The default name.

public static string DefaultName

Field Value

string

Properties

Alpha

Gets or sets the alpha.

public double Alpha { get; set; }

Property Value

double

AutoCrop

Gets or sets a value indicating whether videobox will automatically crop/pad the input video to be centered in the output.

public bool AutoCrop { get; set; }

Property Value

bool

BorderAlpha

Gets or sets the border alpha.

public double BorderAlpha { get; set; }

Property Value

double

Bottom

Gets the pixels to crop at bottom. Positive values will crop, negative values will pad.

public int Bottom { get; }

Property Value

int

Fill

Gets or sets the fill.

public VideoBoxFill Fill { get; set; }

Property Value

VideoBoxFill

Left

Gets the pixels to crop at left. Positive values will crop, negative values will pad.

public int Left { get; }

Property Value

int

Right

Gets the pixels to crop at right. Positive values will crop, negative values will pad.

public int Right { get; }

Property Value

int

StartTime

Gets or sets the start time. Used only in VideoEditCoreX.

public TimeSpan StartTime { get; set; }

Property Value

TimeSpan

StopTime

Gets or sets the stop time. Used only in VideoEditCoreX.

public TimeSpan StopTime { get; set; }

Property Value

TimeSpan

Top

Gets the pixels to crop at top. Positive values will crop, negative values will pad.

public int Top { get; }

Property Value

int

Methods

GenerateDescription()

Generates the description.

public string GenerateDescription()

Returns

string

A string containing the GStreamer element description for the videobox effect.