Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

what is the difference between using QCamera::supportedViewfinderResolutions and QCameraImageCapture::supportedResolutions?



  • Hi
    I am using Qt5.12.10 multimedia module,
    I found, with the same camera, on Windows I can get all resolution of my camera by using QCamera::supportedViewfinderResolutions(), but on Linux (Ubuntu18.04) , it return empty list.

    after test Qt camera example, I found I can got resolutions by using QCameraImageCapture::supportedResolutions().

    so, what is the difference between using QCamera::supportedViewfinderResolutions and QCameraImageCapture::supportedResolutions? which way is the correct way to write a cross application?

    Thanks for your time.


  • Lifetime Qt Champion

    Hi,

    If memory serves well, the second one is for the size of the images the encoder can generate.

    The first one is for the viewfinder to show.

    Did you ensure that the camera is loaded before checking that one ?



  • @SGaist
    thank you ver much.

    I check it when the camera state is QCamera::ActiveState, this is working on windows not on linux

    connect(camera, &QCamera::stateChanged, this, [this](QCamera::State state){
    	qDebug() << "QCamera::State" << state;
    	if (QCamera::ActiveState == state) {
    
    #ifdef QT_DEBUG
    		for (const auto& rate : camera->supportedViewfinderFrameRateRanges(settings)) {
    			qDebug() << "rate: " << rate.minimumFrameRate << rate.maximumFrameRate;
    		}
    		qDebug() << camera->supportedViewfinderPixelFormats();
    		qDebug() << camera->supportedViewfinderResolutions();
    #endif
    		QList<QCameraViewfinderSettings > ViewSets = camera->supportedViewfinderSettings();
    		foreach (QCameraViewfinderSettings ViewSet, ViewSets) {
    			qDebug() << "haha" << ViewSet.pixelFormat() 
    					 << " " << ViewSet.resolution().width()
    					 << " " << ViewSet.resolution().height() 
    					 << "," << ViewSet.minimumFrameRate();
    		}
    	}
    }, Qt::QueuedConnection);
    

  • Lifetime Qt Champion

    Is it the same camera ?
    Is it properly detected on Linux ?



  • @SGaist
    hi
    it is the same camera, and it can be properly detected on Linux,
    the Qt camera example can work with my camera on Linux, just I can not get all resolution of my camera by using QCamera::supportedViewfinderResolutions() on Linux


  • Lifetime Qt Champion

    Can GStreamer return that information ?



  • @SGaist
    I am sorry, I fogot this question so long.

    the output of gst-device-monitor-1.0 is

    Device found:
    
    	name  : LAIQU-RX Camera : LAIQU-RX Came
    	class : Video/Source
    	caps  : video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)5/1;
    	        video/x-raw, format=(string)YUY2, width=(int)1600, height=(int)896, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)5/1;
    	        video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)10/1;
    	        video/x-raw, format=(string)YUY2, width=(int)1024, height=(int)768, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/1;
    	        video/x-raw, format=(string)YUY2, width=(int)960, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)10/1;
    	        video/x-raw, format=(string)YUY2, width=(int)1024, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)15/1;
    	        video/x-raw, format=(string)YUY2, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)20/1;
    	        video/x-raw, format=(string)YUY2, width=(int)864, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)10/1;
    	        video/x-raw, format=(string)YUY2, width=(int)800, height=(int)448, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)20/1;
    	        video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        video/x-raw, format=(string)YUY2, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        video/x-raw, format=(string)YUY2, width=(int)352, height=(int)288, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        video/x-raw, format=(string)YUY2, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)1600, height=(int)896, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)1280, height=(int)1024, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 5/1 };
    	        image/jpeg, width=(int)960, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)1024, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)960, height=(int)544, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 5/1 };
    	        image/jpeg, width=(int)864, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)800, height=(int)448, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 5/1 };
    	        image/jpeg, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)352, height=(int)288, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	        image/jpeg, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1;
    	properties:
    		udev-probed = true
    		device.bus_path = pci-0000:00:0c.0-usb-0:2:1.0
    		sysfs.path = /sys/devices/pci0000:00/0000:00:0c.0/usb1/1-2/1-2:1.0/video4linux/video0
    		device.bus = usb
    		device.subsystem = video4linux
    		device.vendor.id = 0c45
    		device.vendor.name = "LAIQU-RX\\x20Camera\\x20"
    		device.product.id = 6366
    		device.product.name = "LAIQU-RX\ Camera\ :\ LAIQU-RX\ Came"
    		device.serial = LAIQU-RX_Camera_LAIQU-RX_Camera_SN0001
    		device.capabilities = :capture:
    		device.api = v4l2
    		device.path = /dev/video0
    		v4l2.device.driver = uvcvideo
    		v4l2.device.card = "LAIQU-RX\ Camera\ :\ LAIQU-RX\ Came"
    		v4l2.device.bus_info = usb-0000:00:0c.0-2
    		v4l2.device.version = 328805 (0x00050465)
    		v4l2.device.capabilities = 2225078273 (0x84a00001)
    		v4l2.device.device_caps = 69206017 (0x04200001)
    	gst-launch-1.0 v4l2src ! ...
    
    
    

  • Lifetime Qt Champion

    Can you test a more recent version of Qt ?


Log in to reply