[Interest] QCamera -> how to set resolution
Alexander Carôt
alexander_carot at gmx.net
Mon Oct 14 23:51:12 CEST 2024
Hello all,
I have been using an Intel macOS with Sonoma 14.5 most of my time – here video processing with Qt6.8 works fine. I simply do frame-by-frame image capture and display the images in 16:9 format.
However, on an Apple-Silicon-M1 Mac also with Sonoma 14.5 I have a problem with the resolution of the inbuilt cam which seems to not have a default 16:9 resolution – thus, the image is shrinked.
So far I do (simplified):
=========================
QSize resolution(1280, 720);
camera = new QCamera( QMediaDevices::defaultVideoInput() );
captureSession.setCamera(camera);
captureSession.setImageCapture(&imageCapture);
imageCapture.setResolution(resolution);
camera->start();
And I additionally tied this after instantiating the camera object:
===================================================================
QCameraFormat myCamFormat;
myCamFormat.resolution().setWidth(1280);
myCamFormat.resolution().setHeight(720);
camera->setCameraFormat(myCamFormat);
However, it did not resolve the isse – can anyone advise how to do it ?
Thanks beforehand,
best
Alex
--
http://www.carot.de
Email : Alexander at Carot.de
Tel.: +49 (0)177 5719797
More information about the Interest
mailing list