Have tried to wait until camera is in active status? And why you set timer interval to 40 ms?
pt., 14 wrz 2018, 15:19 użytkownik "Alexander Carôt" < alexander_ca...@gmx.net> napisał: > ... sorry, I forgot the subject line in my last post (fixed now): > > Hi all, > > I have a video related app, which works fine but it takes 35 seconds after > initialization for the cam to work in single-capture modus. The code looks > like this: > > Camera::Camera() : ui(new Ui::Camera){ > ui->setupUi(this); > > QCameraViewfinderSettings cameraSettings; > cameraSettings.setMinimumFrameRate(25); > > camera = new QCamera( QCameraInfo::defaultCamera() ); > imageCapture = new QCameraImageCapture(camera); > > this->connect(imageCapture, &QCameraImageCapture::imageCaptured, this, > &Camera::imageCaptured); > > camera->setViewfinder(ui->viewfinder); > > captureTimer = new QTimer(this); > captureTimer->setInterval(40); > connect(captureTimer, SIGNAL(timeout()), this, SLOT(takePicture())); > captureTimer->start(); > > camera->start(); > } > > void Camera::imageCaptured(){ > cout << "IMAGE PROCESSED" << endl; /// THIS IS TRIGGERED THE FIRST > TIME AFTER 35 SECONDS > } > > void Camera::takePicture(){ > imageCapture->capture(); > } > > This happens on OSX with the default inbuilt cam. I have not tested it on > other OSes yet but is there way to speed this time up or is it even a bug I > am having here ? > > Thanks in advance, > best > > Alex > > > > -- > http://www.carot.de > Email : alexan...@carot.de > Tel.: +49 (0)177 5719797 > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest