the camera remains switched on during use, if you try to use the camera again, it is unavailable

Davide Coletti 0 Reputation points
2023-07-06T20:10:27.2266667+00:00

We have developed an app that allows you to take photos, but lately randomly when a photo is taken the webcam stays on and doesn't allow the next shot.

See OS 10.0.22621.1113

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.
397 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Zuocheng Wang - MSFT 3,091 Reputation points Microsoft Vendor
    2023-07-13T02:33:28.94+00:00

    Are you re-calling the entire code snippet above every time you capture a photo? According to the docs, you don't need to re-Initialize each time - https://video2.skills-academy.com/en-us/windows/uwp/audio-video-camera/basic-photo-video-and-audio-capture-with-mediacapture#capture-a-photo-to-a-softwarebitmap.

    Also, you can refer to this sample, it works well in my test - Windows-universal-samples/Samples/CameraStarterKit at main · microsoft/Windows-universal-samples · GitHub.

    0 comments No comments

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.