none
(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,
    Hart

    你好,

    你所发的是中文C#论坛,如果你是中国人也可以看下面我中文的回复。

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

    因为你的问题涉及到UWP你可以去下面的论坛发帖。

    https://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?forum=wpdevelop

    希望我的回复能帮助到你,并且快速解决问题。


    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 MSDNFSF@microsoft.com.

    2016年11月28日 8:04
    版主