(UWP) How to get frame from video RRS feed


  • Hi Vike Li,
    Thank you for posting here.

    If you request a preview frame, you can specify the format in which you would like to receive the frame by creating a VideoFrame object with the format you desire. This example creates a video frame that is the same resolution as the preview stream by calling VideoDeviceController.GetMediaStreamProperties and specifying MediaStreamType.VideoPreview to request the properties for the preview stream.
    You can refer to below code.

    // Get information about the preview
    var previewProperties = _mediaCapture.VideoDeviceController.GetMediaStreamProperties(MediaStreamType.VideoPreview) as VideoEncodingProperties;
    // Create a video frame in the desired format for the preview frame
    VideoFrame videoFrame = new VideoFrame(BitmapPixelFormat.Bgra8, (int)previewProperties.Width, (int)previewProperties.Height);

    For more information, please see the link of  Get a preview frame.
    Best Regards,



    如果你想获取一帧数据从一堆视频数据中,首先你需要创建一个videoframe并且带有你想要的格式(RGB,H264......), 然后video都是一帧一帧的显示,就会有预显示,这样你就可以得到你想要的一帧数据,通过MediaStreamType.VideoPreview。



    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    2016年11月28日 8:04