Search code examples
c#uwpraspberry-piwindows-10-iot-corewebcam-capture

Taking a photo from a WebCam in UWP Background (headless) App on Win 10 IoT


I've written a headless UWP Background Application and deployed it to a Raspberry PI running Windows 10 IoT. The Pi has an old Logitech webcam plugged into one of the USB ports and I'd like to be able to capture still images from it.

I've lifted code from a Microsoft Blog on the subject (albeit aimed at UWP on the Xbox), but my app seems unable to detect any cameras at all. The following call comes back with no results:

var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

As you can see from this screenshot of the remote client, the device recognises that there's a camera attached, so why can't I access it in code?

enter image description here

I've checked the app's manifest, and I've granted access to both the Microphone and WebCam. According to all the articles I've found, that should do it, but I'm still not having any luck.


Solution

  • It may be compatibility issue of your Logitech webcam.Please reference Hardware compatibility list.You can try to install the driver of your Logitech webcam manually, or choose a compatibility webcam and then try again.How to install usb webcam drivers please see here.