新手上路
- 积分
- 36
- 金钱
- 36
- 注册时间
- 2020-9-9
- 在线时间
- 9 小时
|
5金钱
在linux上运行qt程序,,摄像头只出现一帧画面之后就不显示了并弹出CameraBin error: "Device '/dev/video0' failed during initialization"错误警告
代码如下:
Widget::Widget(QWidget *parent) : QWidget(parent){ this->resize(1024,600);
QCamera *camera = new QCamera("/dev/video0",this); QCameraViewfinder *vfinder = new QCameraViewfinder(this); QMediaRecorder *recorder = new QMediaRecorder(camera,this); QVideoEncoderSettings settings = recorder->videoSettings(); settings.setResolution(640,480); settings.setQuality(QMultimedia::VeryHighQuality); settings.setFrameRate(30.0); recorder->setVideoSettings(settings); camera->setCaptureMode(QCamera::CaptureStillImage); vfinder->setGeometry(10,10,640,480); vfinder->move(20,20); camera->setViewfinder(vfinder); camera->start();}
|
-
错误警告
|