question

tssinwh-2854 avatar image
0 Votes"
tssinwh-2854 asked ZuochengWang-MSFT commented

Hololens2 poor performance while get camera frames

i need get hololens camera frames real time. at least 30 fps.
then i found this sample Windows-universal-samples/CameraFrames.
this sample use windows.media.capture.mediacapture and windows.media.capture.frames.mediaframereader.
there be unstable fps (10-20) and high cpu usage when i run this sample on hololens2.


is anything wrong with this sample? or with hololens2?
if you know that please let me know.
if you know other way to get frames on hololens2, please let me know.



windows-uwphololens-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ZuochengWang-MSFT avatar image
0 Votes"
ZuochengWang-MSFT answered ZuochengWang-MSFT commented

Hello, Welcome to Microsoft Q&A,

In my test, when just running this sample, the frame rate (about 50) and CPU usage are in a reasonable range. And you can try to choose a lower resolution Media format to reduce consumption. Also, are you running the application in debug mode? This will cost more performance.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your help.
My case is rather complicated.
My app receive h264 stream (1080p, 30fps, 5mbps), hwdecode and render real time. If i start get camera frame (896*504, 30fps) at same time, app will be low fps even block few seconds.
There is another case. My app runs few minutes without get camera frame, and the hololens2 temperature is going up.Then i close my app and start this CameraFrames sample immediately. And this sample be same as the description of question even low resolution.
Is there anything i can do to optimize performance?

0 Votes 0 ·

You can refer Using the Windows Device Portal - Mixed Reality | Microsoft Learn for performance tracking via portal or WPA. And this document may be useful to you - Optimize animations, media, and images - UWP applications | Microsoft Learn.

0 Votes 0 ·