Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

Creating Software Bitmap from Direct3D surface fails.

Hi,

As part of my work on HoloLens, I am trying to capture the frames through media capture.

  1. I used the UWP API of MediaFrameReader to process the frames.
  2. I created a Windows UWP class library which has the above functionality.
  3. I then added the UWP class library as a plugin in the Unity Project with target framework as .NET 4.6 experimental
  4. Invoked this Library from a Script I have created.

As mentioned in the documentation, when the MediaCapture is initialized we have an option to set the MemoryPreference to either "Auto" or "Cpu". When I set the MemoryPreference as "Cpu", the app works as expected. However, the frame rate is slow.

To take advantage of the graphics card and get a higher frame rate I have set the MemoryPreference as "Auto" and from each frame reference, I am trying to get hold of the SoftwareBitmap by using the method SoftwareBitmap.CreateCopyFromSurfaceAsync(surface) which is the way as described here: https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/process-media-frames-with-mediaframereader

"MemoryPreference - If you specify CPU, the system will use CPU memory which guarantees that when frames arrive, they will be available as SoftwareBitmap objects. If you specify Auto, the system will dynamically choose the optimal memory location to store frames. If the system chooses to use GPU memory, the media frames will arrive as an IDirect3DSurface object and not as a SoftwareBitmap."

When I set the MemoryPreference as Auto and try getting the software bitmap from the Direct3DSurface, I get an exception the surface is null.

Any pointers on how to resolve this will be of great help.

Sign In or Register to comment.