see below - as a first acceptable temporary solution I am constantly detecting 
the actual resolution and if it does not match the one I adjusted I simply 
restart the cam.

So - at least for now the issue is fixed.

Best

Alex

--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797


> Gesendet: Donnerstag, 19. Juli 2018 um 23:27 Uhr
> Von: "Alexander Carôt" <alexander_ca...@gmx.net>
> An: "qt qt" <interest@qt-project.org>
> Betreff: [Interest] QCamera resolution problem
>
> Hello all,
> 
> I have a problem with setting the resolution of external USB-webcam on OSX. 
> 
> I initialize my cam like this:
> 
> 
> void soundjack::startVideo(int index){
>   QCameraViewfinderSettings cameraSettings;
>   QSize resolution(640,480);
>   cameraSettings.setResolution(resolution); 
> 
>   camera = new QCamera(availableCameras[index]);  
>   camera->setCaptureMode(QCamera::CaptureStillImage);
>   camera->setViewfinderSettings(cameraSettings);    
>  
>   imageCapture = new QCameraImageCapture(camera);
>     
>   camera->setViewfinder(ui->viewfinder);
>   connect(imageCapture, &QCameraImageCapture::imageCaptured, this, 
> &soundjack::processImage);
> 
>   camera->start();
> } 
> 
> and I stop my cam like this:
> 
> void soundjack::stopVideo(){
>   camera->stop();
> 
>   delete camera;
>   delete imageCapture;
> }
> 
> 
> When I am running this code on my MacBook Pro withe the inbuilt Facetime cam 
> everything works out fine. However, with two external USB-webcams on the same 
> machine I have the following problem:
> 
> When I initialize the cam the first time all is working fine but when 
> stopping it or changing to the inbuilt cam and then relaunching it for the 
> second time the resolution is set to 1280 x 720 instead of 640 x 480. 
> 
> Stopping it again or changing to the inbuilt cam and then launching it for 
> the third time leads to the desired 640 x 480.
> 
> In other words: Every other attempt works.
> 
> Can anyone help how to get rid of this problem ?
> 
> 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

Reply via email to