How to initialize USB Webcam using mediaCapture.InitializeAsync()? RRS feed

  • Question

  • Hello everyone,

    1. Background

    I am trying this example https://docs.microsoft.com/en-us/samples/microsoft/windows-iotcore-samples/webcam-app/ to capture a still image from my USB Webcam. But I realized I have to initialize my USB, not the built-in one used in the example. This example used mediaCapture.InitializeAsync() to initialize default webcam(built-in one), but I think I have to use mediaCapture.InitializeAsync(mediaCaptureInitializationSetting). But to do this, I need to specify my USB Webcam configurations inside the mediaCaptureInitializationSetting class. 

    2. What I did

    // List all the video capture devices

    DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);

    // Loop the device list and print the device ID
    foreach (var device in devices)
          // How to filter my USB Webcam here?

    3. Question

    How can I filter my USB device aside from the built-in webcam? It is using USB so there's gotta be a way to distinguish it from the built-in one. Any suggestions?

    Thursday, July 30, 2020 11:33 PM

All replies

  • Hi dalsee,

    What operating system will you run on this sample? 

    Since the question is from this sample, we also suggest you can report it to github page.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, July 31, 2020 9:49 AM