VideoFrame VideoFrame VideoFrame VideoFrame Class

Definition

Represents a single frame of video data.

public : sealed class VideoFrame : IClosable, IMediaFrame, IVideoFramepublic sealed class VideoFrame : IDisposable, IMediaFrame, IVideoFramePublic NotInheritable Class VideoFrame Implements IDisposable, IMediaFrame, IVideoFrame// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

VideoFrame(BitmapPixelFormat, Int32, Int32) VideoFrame(BitmapPixelFormat, Int32, Int32) VideoFrame(BitmapPixelFormat, Int32, Int32) VideoFrame(BitmapPixelFormat, Int32, Int32)

Initializes a new instance of the VideoFrame class.

public : VideoFrame(BitmapPixelFormat format, int width, int height)public VideoFrame(BitmapPixelFormat format, Int32 width, Int32 height)Public Sub New(format As BitmapPixelFormat, width As Int32, height As Int32)// You can use this method in JavaScript.
Parameters
format
BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

The pixel format of the video frame.

width
int Int32 Int32 Int32

The width of the video frame, in pixels.

height
int Int32 Int32 Int32

The height of the video frame, in pixels.

See Also

VideoFrame(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) VideoFrame(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) VideoFrame(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode) VideoFrame(BitmapPixelFormat, Int32, Int32, BitmapAlphaMode)

Initializes a new instance of the VideoFrame class.

public : VideoFrame(BitmapPixelFormat format, int width, int height, BitmapAlphaMode alpha)public VideoFrame(BitmapPixelFormat format, Int32 width, Int32 height, BitmapAlphaMode alpha)Public Sub New(format As BitmapPixelFormat, width As Int32, height As Int32, alpha As BitmapAlphaMode)// You can use this method in JavaScript.
Parameters
format
BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat BitmapPixelFormat

The pixel format of the video frame.

width
int Int32 Int32 Int32

The width of the video frame, in pixels.

height
int Int32 Int32 Int32

The height of the video frame, in pixels.

alpha
BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode BitmapAlphaMode

The alpha mode of the video frame.

See Also

Properties

Direct3DSurface Direct3DSurface Direct3DSurface Direct3DSurface

Gets the IDirect3DSurface object containing the pixel data of the video frame, when one is present.

public : IDirect3DSurface Direct3DSurface { get; }public IDirect3DSurface Direct3DSurface { get; }Public ReadOnly Property Direct3DSurface As IDirect3DSurface// You can use this property in JavaScript.
Value
IDirect3DSurface IDirect3DSurface IDirect3DSurface IDirect3DSurface

The IDirect3DSurface object containing the pixel data of the video frame.

Remarks

The pixel data of a VideoFrame can be stored either in a IDirect3DSurface or a SoftwareBitmap. This property will be null if the data for the frame is not stored in a IDirect3DSurface. If the data is stored in a software bitmap, you can access it using the SoftwareBitmap property of the VideoFrame.

Duration Duration Duration Duration

Gets or sets the duration of the video frame.

public : IReference<TimeSpan> Duration { get; set; }public Nullable<TimeSpan> Duration { get; set; }Public ReadWrite Property Duration As Nullable<TimeSpan>// You can use this property in JavaScript.
Value
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

The duration of the video frame.

ExtendedProperties ExtendedProperties ExtendedProperties ExtendedProperties

Gets the extended property set which enables getting and setting properties on the media frame.

public : IPropertySet ExtendedProperties { get; }public IPropertySet ExtendedProperties { get; }Public ReadOnly Property ExtendedProperties As IPropertySet// You can use this property in JavaScript.
Value
IPropertySet IPropertySet IPropertySet IPropertySet

The extended properties map.

IsDiscontinuous IsDiscontinuous IsDiscontinuous IsDiscontinuous

Gets or sets a value that indicates whether an video frame is the first frame after a gap in the stream.

public : PlatForm::Boolean IsDiscontinuous { get; set; }public bool IsDiscontinuous { get; set; }Public ReadWrite Property IsDiscontinuous As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the video frame is the first frame after a gap in the stream; otherwise, false.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value indicating whether the video frame is read-only.

public : PlatForm::Boolean IsReadOnly { get; }public bool IsReadOnly { get; }Public ReadOnly Property IsReadOnly As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the video frame is read-only; otherwise, false.

Remarks

When this value is true, both the video data and the mutable properties of the video frame are read-only.

RelativeTime RelativeTime RelativeTime RelativeTime

Gets or sets the relative time of the frame within the video stream.

public : IReference<TimeSpan> RelativeTime { get; set; }public Nullable<TimeSpan> RelativeTime { get; set; }Public ReadWrite Property RelativeTime As Nullable<TimeSpan>// You can use this property in JavaScript.
Value
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

The relative time of the frame within the video stream.

Remarks

Use SystemRelativeTime to get a timestamp that is relative to the system and is correlatable across multiple media sources on the same device.

SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap

Gets the SoftwareBitmap object containing the pixel data of the video frame, when one is present.

public : SoftwareBitmap SoftwareBitmap { get; }public SoftwareBitmap SoftwareBitmap { get; }Public ReadOnly Property SoftwareBitmap As SoftwareBitmap// You can use this property in JavaScript.
Value
SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap

The SoftwareBitmap object containing the pixel data of the video frame.

Remarks

The pixel data of a VideoFrame can be stored either in a Direct3DSurface or a SoftwareBitmap. This property will be null if the data for the frame is not stored in a SoftwareBitmap. If the data is stored in a software bitmap, you can access it using the Direct3DSurface property of the VideoFrame.

SystemRelativeTime SystemRelativeTime SystemRelativeTime SystemRelativeTime

Gets or sets a timestamp that is relative to the system and is correlatable across multiple media sources on the same device.

public : IReference<TimeSpan> SystemRelativeTime { get; set; }public Nullable<TimeSpan> SystemRelativeTime { get; set; }Public ReadWrite Property SystemRelativeTime As Nullable<TimeSpan>// You can use this property in JavaScript.
Value
IReference<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan> Nullable<TimeSpan>

A timestamp relative to the system.

Remarks

Use RelativeTime to get a timestamp that is relative to the video stream.

Type Type Type Type

Gets a string indicating the type of video data the video frame contains.

public : PlatForm::String Type { get; }public string Type { get; }Public ReadOnly Property Type As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string indicating the type of audio data the video frame contains.

Methods

Close() Close() Close() Close()

Disposes of the object and associated resources.

public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.

CopyToAsync(VideoFrame) CopyToAsync(VideoFrame) CopyToAsync(VideoFrame) CopyToAsync(VideoFrame)

Copies the current VideoFrame into a provided VideoFrame object.

public : IAsyncAction CopyToAsync(VideoFrame frame)public IAsyncAction CopyToAsync(VideoFrame frame)Public Function CopyToAsync(frame As VideoFrame) As IAsyncAction// You can use this method in JavaScript.
Parameters
frame
VideoFrame VideoFrame VideoFrame VideoFrame

The target video frame into which the current frame will be copied.

Returns

Remarks

The target frame must have the same pixel format, width, height, and alpha mode as the source frame.

Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()