目录
查看相机个数
查看相机个数
配置文件:
QT += multimedia
#include <QCameraInfo>
#include <QDebug>void listCameras() {QList<QCameraInfo> cameras = QCameraInfo::availableCameras();foreach (const QCameraInfo &cameraInfo, cameras) {qDebug() << "Camera:" << cameraInfo.description();qDebug() << "Device name:" << cameraInfo.deviceName();qDebug() << "Position:" << (cameraInfo.position() == QCamera::Position::Back ? "Back" : "Front");}
}
读取可以用opencv读取。