【问题标题】:Using MixedReality-WebRTC Screen Capture使用 MixedReality-WebRTC 屏幕捕获
【发布时间】:2020-12-21 19:54:57
【问题描述】:

我正在使用 MixedReality-WebRTC 制作 UWP 应用。

有没有办法实时获取当前屏幕,而不是网络摄像头?

【问题讨论】:

  • 嘿,你知道如何实现你想要的吗?

标签: c# uwp


【解决方案1】:

有没有办法实时获取当前屏幕

当然,您可以使用GraphicsCapturePicker 来选择要捕获的窗口,然后使用屏幕捕获 api 获取带有FrameArrived 事件的实时帧。

_framePool.FrameArrived += (s, a) =>
{
    // The FrameArrived event fires for every frame on the thread that
    // created the Direct3D11CaptureFramePool. This means we don't have to
    // do a null-check here, as we know we're the only one  
    // dequeueing frames in our application.  

    // NOTE: Disposing the frame retires it and returns  
    // the buffer to the pool.
    using (var frame = _framePool.TryGetNextFrame())
    {
        // We'll define this method later in the document.
        ProcessFrame(frame);
    }  
};

这里是official document,您可以参考。

【讨论】:

  • 谢谢。我第一次通过 UWP 从事 WebRTC 项目时遇到了各种困难。
  • 你能告诉我如何使用 microsoft / Mixed Reality-WebRTC 来传递 UWP 屏幕而不是网络摄像头吗?
  • @Nico Zhu - MSFT 我尝试了你所说的,但现在我有一个 Direct3D11CaptureFrame,但 MR-WebRTC 需要 YUV420 中的一个框架。你知道如何转换吗?
  • @Nico Zhu - MSFT 我也在此处创建了一个post
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-03-15
  • 1970-01-01
  • 2011-10-09
  • 2015-04-06
  • 2018-11-03
  • 2012-04-19
相关资源
最近更新 更多