Search code examples
c#unity-game-enginevideo-capturehololens

Hololens - Access Camera Frames


How can I access all frames in a video stream from the hololens camera, when in 3D mode? I'm using C#.

The unity VideoCapture class doesn't seem to provide this: http://docs.unity3d.com/550/Documentation/ScriptReference/VR.WSA.WebCam.VideoCapture.html

and the microsoft MediaCapture class with method MediaCapture.StartPreviewToCustomSinkAsync is not very well documented. https://msdn.microsoft.com/en-us/library/windows/desktop/ms701626(v=vs.85).aspx


Solution

  • You can try using the MediaCapture FrameReader API

    Documentation: https://msdn.microsoft.com/en-gb/windows/uwp/audio-video-camera/process-media-frames-with-mediaframereader#create-a-frame-reader-for-the-frame-source

    Sample code: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraFrames