Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. what is the difference between using QCamera::supportedViewfinderResolutions and QCameraImageCapture::supportedResolutions?
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 2 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MozzieM Offline
    MozzieM Offline
    Mozzie
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      MozzieM 1 Reply Last reply
      0
      • SGaistS SGaist

        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 ?

        MozzieM Offline
        MozzieM Offline
        Mozzie
        wrote on last edited by
        #3

        @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);
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          MozzieM 1 Reply Last reply
          0
          • SGaistS SGaist

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

            MozzieM Offline
            MozzieM Offline
            Mozzie
            wrote on last edited by
            #5

            @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

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Can GStreamer return that information ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              MozzieM 1 Reply Last reply
              0
              • SGaistS SGaist

                Can GStreamer return that information ?

                MozzieM Offline
                MozzieM Offline
                Mozzie
                wrote on last edited by
                #7

                @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 ! ...
                
                
                
                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Can you test a more recent version of Qt ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  MozzieM 2 Replies Last reply
                  0
                  • SGaistS SGaist

                    Can you test a more recent version of Qt ?

                    MozzieM Offline
                    MozzieM Offline
                    Mozzie
                    wrote on last edited by
                    #9

                    @SGaist said in what is the difference between using QCamera::supportedViewfinderResolutions and QCameraImageCapture::supportedResolutions?:

                    an you test a more recent version of Qt ?

                    em.........I will try, give me some time

                    1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Can you test a more recent version of Qt ?

                      MozzieM Offline
                      MozzieM Offline
                      Mozzie
                      wrote on last edited by
                      #10

                      @SGaist

                      One more thing, what information do you need from test?

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        As silly as it may sound: does it work ?
                        If so, then the backend has been updated and all is well. You can back port the possible fixes if need and if it's not working then this will be material for a potential ticket to open.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved