How to access camera preview frames with MediaCapture class in Unity?

Valentin 40 Reputation points
2024-11-15T08:24:11.62+00:00

Using the Windows MediaCapture class we can capture videos and images on the HoloLens 2. The class also offers preview capabilities (see here). However, I am not sure how to get the preview stream within Unity and then display it to the user. In the docs they suggest to connect a XML CaptureElement to the mediaCapture object. What's the equivalent for use in Unity/on Hololens 2? A similar question without an answer has been asked 7 years ago here

Universal Windows Platform (UWP)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,038 questions
HoloLens Development
HoloLens Development
HoloLens: A family of Microsoft self-contained, holographic devices that enable engagement with digital content and interaction with holograms in the surrounding environment.Development: The process of researching, productizing, and refining new or existing technologies.
402 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.