Class AspectRatioCropVideoEffect
- Namespace
- VisioForge.Core.Types.X.VideoEffects
- Assembly
- VisioForge.Core.dll
Represents an aspect ratio crop effect that automatically crops video to match a target aspect ratio.
public class AspectRatioCropVideoEffect : BaseVideoEffect, IBaseVideoEffect, IVideoEditXVideoEffectInheritance
Implements
Inherited Members
Remarks
SDK Availability: VideoCaptureCoreX, MediaPlayerCoreX, VideoEditCoreX, Media Blocks SDK
Platform Support: Windows, Linux, macOS, Android, iOS
The aspect ratio crop effect automatically calculates and removes pixels from video edges to achieve a target aspect ratio. Unlike manual cropping, this effect preserves the maximum video area while converting between aspect ratios (e.g., 4:3 to 16:9, 16:9 to 9:16 for vertical video).
Common Aspect Ratios:
- 16:9: Standard widescreen HD/Full HD (1920x1080)
- 4:3: Traditional TV and older content
- 21:9: Ultrawide cinematic format
- 9:16: Vertical video for mobile and social media
- 1:1: Square format for Instagram and social media
- 2.35:1 or 2.39:1: Cinema widescreen formats
Cropping Behavior:
- Crops from center outward to preserve important content
- Removes pixels equally from opposite edges when possible
- Maintains maximum resolution within target aspect ratio
- Zero-copy operation for efficiency
Common Use Cases:
- Converting widescreen to vertical for mobile/social media
- Preparing content for specific display formats
- Removing letterboxing or pillarboxing
- Creating square videos for Instagram
- Standardizing mixed aspect ratio content
For Classic SDK, aspect ratio adjustments are handled through output format settings. For manual edge cropping with pixel-perfect control, see VisioForge.Core.Types.X.VideoEffects.CropVideoEffect.
Performance Note: Aspect ratio cropping is extremely efficient as it only manipulates frame metadata. Has virtually no CPU impact and is suitable for all platforms including mobile.
Constructors
AspectRatioCropVideoEffect(int, int)
Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.AspectRatioCropVideoEffect class.
public AspectRatioCropVideoEffect(int x, int y)Parameters
xint-
The horizontal component of the aspect ratio.
yint-
The vertical component of the aspect ratio.
Fields
DefaultName
The default name.
public static string DefaultNameField Value
Properties
AspectRatio
Gets the aspect ratio.
public Tuple<int, int> AspectRatio { get; }Property Value
StartTime
Gets or sets the start time. Used only in VideoEditCoreX.
public TimeSpan StartTime { get; set; }Property Value
StopTime
Gets or sets the stop time. Used only in VideoEditCoreX.
public TimeSpan StopTime { get; set; }Property Value
Methods
GenerateDescription()
Generates the description.
public string GenerateDescription()Returns
- string
-
A string containing the GStreamer element description for the aspect ratio crop effect.