[Interest] (no subject)

"Alexander CarĂ´t" alexander_carot at gmx.net
Fri Sep 14 14:39:25 CEST 2018


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 : Alexander at Carot.de
Tel.: +49 (0)177 5719797



More information about the Interest mailing list