Class VideoFrameInfoX
- Namespace
- VisioForge.Core.Types.X
- Assembly
- VisioForge.Core.dll
Represents detailed information about a video frame, including its dimensions, pixel format, stride, and frame rate. This class is used within the MediaBlocks framework to describe the characteristics of video data.
public class VideoFrameInfoXInheritance
Derived
Inherited Members
Examples
// Create a VideoFrameInfoX instance for a Full HD, NV12 video at 30 FPS.
var videoInfo = new VideoFrameInfoX(1920, 1080, VideoFormatX.NV12, new VideoFrameRate(30, 1));
Console.WriteLine($"Video Format: {videoInfo.Format}");
Console.WriteLine($"Resolution: {videoInfo.Width}x{videoInfo.Height}");
Console.WriteLine($"Frame Rate: {videoInfo.FrameRate.Value:F2} FPS");
Console.WriteLine($"Calculated Stride: {videoInfo.Stride}");
// This videoInfo object can then be used to configure a video encoder or renderer.
// videoEncoder.SetVideoInfo(videoInfo);
Remarks
This information is crucial for configuring video processing blocks, encoders, and renderers, ensuring that video data is handled correctly throughout the pipeline. The VisioForge.Core.Types.X.VideoFrameInfoX.Stride property is automatically calculated for common RGB/RGBA formats if not explicitly set.
Constructors
VideoFrameInfoX()
Initializes a new instance of the VisioForge.Core.Types.X.VideoFrameInfoX class with default values.
public VideoFrameInfoX()VideoFrameInfoX(int, int, VideoFormatX, VideoFrameRate, int)
Initializes a new instance of the VisioForge.Core.Types.X.VideoFrameInfoX class with specified dimensions, format, frame rate, and an optional stride.
public VideoFrameInfoX(int width, int height, VideoFormatX format, VideoFrameRate frameRate, int stride = 0)Parameters
widthint-
The width of the video frame.
heightint-
The height of the video frame.
formatVideoFormatX-
The VisioForge.Core.Types.X.VideoFormatX of the video frame.
frameRateVideoFrameRate-
The VisioForge.Core.Types.VideoFrameRate of the video stream.
strideint-
The stride of the video frame. If 0, it will be calculated automatically for common formats.
VideoFrameInfoX(int, int, VideoFrameRate)
Initializes a new instance of the VisioForge.Core.Types.X.VideoFrameInfoX class with specified dimensions and frame rate. The format defaults to VisioForge.Core.Types.X.VideoFormatX.RGB.
public VideoFrameInfoX(int width, int height, VideoFrameRate frameRate)Parameters
widthint-
The width of the video frame.
heightint-
The height of the video frame.
frameRateVideoFrameRate-
The VisioForge.Core.Types.VideoFrameRate of the video stream.
Properties
Format
Gets or sets the pixel format of the video frame.
public VideoFormatX Format { get; set; }Property Value
FrameRate
Gets or sets the frame rate of the video stream.
public VideoFrameRate FrameRate { get; set; }Property Value
Height
Gets or sets the height of the video frame in pixels.
public int Height { get; set; }Property Value
Offsets
Gets or sets an array of offsets for each plane in a planar video format. Optional.
public ulong[] Offsets { get; set; }Property Value
- ulong[]
PlaneCount
Gets or sets the number of planes in the video format. Optional. For planar formats (e.g., I420, NV12), this would be 2 or 3. For packed formats (e.g., RGB, YUY2), it's typically 1.
public int PlaneCount { get; set; }Property Value
Stride
Gets or sets the stride (or pitch) of the video frame in bytes. This is the number of bytes required to store one row of pixels. If not explicitly set, it will be calculated automatically for common RGB/RGBA formats based on VisioForge.Core.Types.X.VideoFrameInfoX.Width and VisioForge.Core.Types.X.VideoFrameInfoX.Format.
public int Stride { get; set; }Property Value
Strides
Gets or sets an array of strides for each plane in a planar video format. Optional.
public int[] Strides { get; set; }Property Value
- int[]
Width
Gets or sets the width of the video frame in pixels.
public int Width { get; set; }Property Value
Methods
ToString()
Returns a string that represents the current VisioForge.Core.Types.X.VideoFrameInfoX instance. The string includes the video format, resolution (widthxheight), and frame rate.
public override string ToString()