在3D模式下,如何访问全息透镜相机视频流中的所有帧?我正在使用c#。
unity VideoCapture
类似乎不提供这个:http://docs.unity3d.com/550/Documentation/ScriptReference/VR.WSA.WebCam.VideoCapture.html
和MediaCapture.StartPreviewToCustomSinkAsync
方法的microsoft MediaCapture
类没有很好的文献记录。https://msdn.microsoft.com/en-us/library/windows/desktop/ms701626 (v = vs.85) . aspx
我们做了一个叫做CameraStream的开源项目来满足这个需求。作为一个Unity插件,它使用MediaCapture将字节数组(以及可定位矩阵)提供给Unity。从那里你可以将字节分配给Texture2D,如所提供的Unity示例所示。
我们的videoccapture类模仿Unity的同名类,以便开发人员熟悉如何使用它。我们也假设这个功能最终将由Unity提供。
你可以尝试使用MediaCapture frameader API
文档:https://msdn.microsoft.com/en-gb/windows/uwp/audio-video-camera/process-media-frames-with-mediaframereader create-a-frame-reader-for-the-frame-source
示例代码:https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraFrames