如何在UWP应用程序中访问外部摄像头? [英] How to access external camera in UWP app ?

查看:347
本文介绍了如何在UWP应用程序中访问外部摄像头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


大家好吗?
我想在uwp app中访问外部摄像头(通过usb),但是这段代码如下:

var devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture)

只返回内置摄像头。

有人告诉我访问外置摄像头的方法吗?

提前感谢。

解决方案

您好,


我目前没有可以测试的设备,所以只需提供一些故障排除步骤。


这里有一个旧线程  https:// social.msdn.microsoft.com/Forums/lync/en-US/3121de8b-2773-421d-9008-49c73f68aa80/how-can-i-find-a-usb-camera-without-using-its-name-in- metro-app-style-c?forum = winappswithcsharp提到他可以使用FindAllAsync
返回USB摄像头。那么您可以从您的收藏中获得多少台相机? 


您可以通过控制面板确认您的相机安装了最新的驱动程序 - >计算机管理 - >设备管理员,找到您的USB设备,然后检查它是否已被系统识别。


您也可以提供官方样本&https://github.com/Microsoft/Windows-universal -samples / tree / master / Samples / CameraProfile试试看它是否能找到你的usb相机,然后告诉我们结果。


祝你好运,


百里


Hi all
I want to access to external camera(pug via usb) in uwp app, but this code below:
var devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture)
only return built-in camera.
Anyone show me the way to access to an external camera ?
Thank in advance.

解决方案

Hello,

I don't have a device to test right now so just provide some troubleshooting steps.

One of an old thread here https://social.msdn.microsoft.com/Forums/lync/en-US/3121de8b-2773-421d-9008-49c73f68aa80/how-can-i-find-a-usb-camera-without-using-its-name-in-metro-app-style-c?forum=winappswithcsharp mentioned that he can use FindAllAsync to return USB cameras. So how many cameras can you get from your collection? 

Can you make sure that you camera has the latest driver installed by go to control panel->computer management->Device Manager, find your USB device and then check if it is already recognized by the system.

You may also give the official sample https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraProfile a try to see if it can find your usb camera and then show us the result.

Best regards,

Barry


这篇关于如何在UWP应用程序中访问外部摄像头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆