You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter Windows应用无法识别USB集线器连接的双摄像头求助

问题:Flutter Windows应用无法识别USB集线器上的两个摄像头

我们正在开发Flutter Windows应用,通过USB集线器将两个摄像头连接到同一USB端口。在Windows 11系统的Chrome浏览器中测试以下JavaScript代码时,可正常识别两个摄像头,但将相同逻辑移植到Flutter中时,仅能识别1个摄像头。已检查并确认Flutter应用拥有完整USB访问权限,且尝试过各类Flutter摄像头库均无效果,请问还有其他可探索的库吗?


浏览器端测试代码

CSS

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

div {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

HTML

<div>
  <video id="camera1" autoplay playsinline></video>
</div>
<div>
  <video id="camera2" controls autoplay></video>
</div>

JavaScript

var camera1 = document.getElementById('camera1')
var camera2 = document.getElementById('camera2')

navigator.mediaDevices.enumerateDevices().then((devices) => {
  console.log('TAG:: available devices ====:: ' + devices.length);

  const cameras = devices.filter(device => device.kind === 'videoinput');
  console.log('TAG:: available cameras ====:: ' + cameras.length);

  cameras.forEach(device => {
    console.log(`TAG:: available camera: ====:: ${device.kind} :: ${device.label} :: ${device.deviceId}`);
    console.log(device.toJSON());
  });
})

浏览器端正常识别的日志

TAG:: available devices ====:: 9
TAG:: available camera: ====:: videoinput :: USB GS Camera Right (0edc:2076) :: f53ef6f475edcc92d8a115adb3c6d43eed136ac763b6b61d81481924e2d6ea03
TAG:: available camera: ====:: videoinput :: USB GS Camera Left (0edc:2076) :: 51094bae387955f5bcede4e2c49a5650b4c839233e9a9de2bc263548e6254e02

内容的提问来源于stack exchange,提问作者Shekar Tippur

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 20:55:30