VideoMediaFrame VideoMediaFrame VideoMediaFrame VideoMediaFrame VideoMediaFrame Class


Represents a frame from a MediaFrameSource that provides data in a video frame represented by a IDirect3DSurface or SoftwareBitmap.

public : sealed class VideoMediaFrame
struct winrt::Windows::Media::Capture::Frames::VideoMediaFrame
public sealed class VideoMediaFrame
Public NotInheritable Class VideoMediaFrame
// This class does not provide a public constructor.

Windows 10 requirements

Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)


Get an instance of this class by accessing the VideoMediaFrame property of a MediaFrameReference object that was obtained from a media frame source.


If you access the SoftwareBitmap or Direct3DSurface objects provided by the VideoMediaFrame property of a MediaFrameReference, the system creates a strong reference to these objects, which means that they will not be disposed when you call Dispose on the containing MediaFrameReference. You must explicitly call the Dispose method of the SoftwareBitmap or Direct3DSurface directly for the objects to be immediately disposed. Otherwise, the garbage collector will eventually free the memory for these objects, but you can't know when this will occur, and if the number of allocated bitmaps or surfaces exceeds the maximum amount allowed by the system, the flow of new frames will stop. In that same line of thought, if you have called (GetVideoFrame())[], then the (VideoFrame)[../] retrieved has a reference on the SoftwareBitmap or Direct3DSurface objects provided by the VideoMediaFrame and needs to be disposed of by calling manually its Dispose method to avoid blocking the fow of frames. If you intend to hold on to a VideoFrame retrieved via (GetVideoFrame())[] for an extended period of time, it may be better to hold on to a copy of it instead.

For how-to guidance on using MediaFrameSource to capture frames, see Process media frames with MediaFrameReader.


CameraIntrinsics CameraIntrinsics CameraIntrinsics CameraIntrinsics CameraIntrinsics

Gets an object that describes the distortion model of the camera that generated the VideoMediaFrame.

DepthMediaFrame DepthMediaFrame DepthMediaFrame DepthMediaFrame DepthMediaFrame

Gets a DepthMediaFrame containing depth data for the VideoMediaFrame, if the frame contains depth data.

Direct3DSurface Direct3DSurface Direct3DSurface Direct3DSurface Direct3DSurface

Gets an IDirect3DSurface object containing the image data for the VideoMediaFrame.

FrameReference FrameReference FrameReference FrameReference FrameReference

Gets the MediaFrameReference wrapper object associated with the VideoMediaFrame, which provides access to format information and other properties of the media frame.

InfraredMediaFrame InfraredMediaFrame InfraredMediaFrame InfraredMediaFrame InfraredMediaFrame

Gets an InfraredMediaFrame containing depth data for the VideoMediaFrame, if the frame contains infrared data.

SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap SoftwareBitmap

Gets a SoftwareBitmap object containing the image data for the VideoMediaFrame.

VideoFormat VideoFormat VideoFormat VideoFormat VideoFormat

Gets an object describing the format of the VideoMediaFrame image data.


GetVideoFrame() GetVideoFrame() GetVideoFrame() GetVideoFrame() GetVideoFrame()

Creates a copy of the VideoMediaFrame as a VideoFrame object.

See also