Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Any example to use libcamera for Qt5 desktop application?
QtWS25 Last Chance

Any example to use libcamera for Qt5 desktop application?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
29 Posts 7 Posters 5.3k Views
  • 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.
  • R Offline
    R Offline
    rollyng
    wrote on 27 Jun 2022, 12:56 last edited by
    #1

    Hi,
    I am new to Qt and I was writing simple C++ code to capture raw image data via the libcamera/libcamera-apps on a Raspberry Pi 4B with 8GB ram and the 64bit Bullseye OS.
    I have installed OpenCV 4.5.2 as well and I would like to write a Qt GUI desktop application where I can view the camera (HQCam IMX477) and save raw data to a SSD as fast as possible.
    Are there any example to view the Raspberry Pi camera in Bullseye with Qt GUI desktop application? I am aware of the old example but it does not work libcamera in Bullseye.
    link text

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 27 Jun 2022, 18:39 last edited by
      #2

      Hi and welcome to devnet,

      Can you explain what you mean by "does not work" ?

      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
      • R Offline
        R Offline
        rollyng
        wrote on 4 Jul 2022, 16:33 last edited by
        #3

        Hi, plz have a look. I have just copied the Qt camera example. It works on my ubuntu laptop which I can see real-time image from the front camera. But as I run on the RaspberryPi 4B Bullseye, it fails to grab any image.
        Screenshot from 2022-06-27 13-37-11.png

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Jul 2022, 17:02 last edited by
          #4

          The error is pretty explicit: you seem to lack memory.

          What else is running on your Pi ?
          What kind of camera are you using ?
          What are the specs of your Pi ?
          What are the specs of your camera ?

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

          R 1 Reply Last reply 5 Jul 2022, 08:45
          0
          • S SGaist
            4 Jul 2022, 17:02

            The error is pretty explicit: you seem to lack memory.

            What else is running on your Pi ?
            What kind of camera are you using ?
            What are the specs of your Pi ?
            What are the specs of your camera ?

            R Offline
            R Offline
            rollyng
            wrote on 5 Jul 2022, 08:45 last edited by
            #5

            @SGaist said in Any example to use libcamera for Qt5 desktop application?:

            The error is pretty explicit: you seem to lack memory.

            What else is running on your Pi ? Nothing special except I have Qt creator running
            What kind of camera are you using ? Official Raspberry Pi HQCam
            What are the specs of your Pi ? 8GB RAM and 32GB SD running Linux RaspberryPi 5.15.45-v8+ #1562 SMP PREEMPT Thu Jun 9 13:59:40 BST 2022 aarch64 GNU/Linux
            What are the specs of your camera ? 640*480 running okay with GStreamer as attached.
            2022-07-05-163825_1920x1080_scrot.png
            2022-07-05-163759_1920x1080_scrot.png

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 5 Jul 2022, 19:33 last edited by
              #6

              What if you start the application without Qt Creator running at the same time ?

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

              R 1 Reply Last reply 6 Jul 2022, 01:41
              0
              • S SGaist
                5 Jul 2022, 19:33

                What if you start the application without Qt Creator running at the same time ?

                R Offline
                R Offline
                rollyng
                wrote on 6 Jul 2022, 01:41 last edited by
                #7

                @SGaist
                Hi, these are the error message produced in Qt Creator.
                09:37:40: Starting /home/pi/code/libcamera-qt5/build-camera-Desktop-Release/camera ...
                Unable to query the parameter info: QCameraImageProcessingControl::WhiteBalancePreset : "Inappropriate ioctl for device"
                Unable to query the parameter info: QCameraImageProcessingControl::ColorTemperature : "Inappropriate ioctl for device"
                Unable to query the parameter info: QCameraImageProcessingControl::ContrastAdjustment : "Inappropriate ioctl for device"
                Unable to query the parameter info: QCameraImageProcessingControl::SaturationAdjustment : "Inappropriate ioctl for device"
                Unable to query the parameter info: QCameraImageProcessingControl::BrightnessAdjustment : "Inappropriate ioctl for device"
                Unable to query the parameter info: QCameraImageProcessingControl::SharpeningAdjustment : "Inappropriate ioctl for device"
                CameraBin error: "Failed to allocate required memory."
                09:38:34: /home/pi/code/libcamera-qt5/build-camera-Desktop-Release/camera exited with code 0
                2022-07-06-094130_1920x1080_scrot.png

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 6 Jul 2022, 19:50 last edited by
                  #8

                  Which version of Qt are you using on your Pi ?

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

                  R 1 Reply Last reply 6 Jul 2022, 22:00
                  0
                  • S SGaist
                    6 Jul 2022, 19:50

                    Which version of Qt are you using on your Pi ?

                    R Offline
                    R Offline
                    rollyng
                    wrote on 6 Jul 2022, 22:00 last edited by
                    #9

                    @SGaist said in Any example to use libcamera for Qt5 desktop application?:

                    Which version of Qt are you using on your Pi ?

                    2022-07-07-055749_1920x1080_scrot.png

                    J J 2 Replies Last reply 6 Jul 2022, 22:28
                    0
                    • R rollyng
                      6 Jul 2022, 22:00

                      @SGaist said in Any example to use libcamera for Qt5 desktop application?:

                      Which version of Qt are you using on your Pi ?

                      2022-07-07-055749_1920x1080_scrot.png

                      J Online
                      J Online
                      JonB
                      wrote on 6 Jul 2022, 22:28 last edited by
                      #10

                      @rollyng
                      Which version of Qt have you installed, not which version of Qt Creator?

                      1 Reply Last reply
                      0
                      • R rollyng
                        6 Jul 2022, 22:00

                        @SGaist said in Any example to use libcamera for Qt5 desktop application?:

                        Which version of Qt are you using on your Pi ?

                        2022-07-07-055749_1920x1080_scrot.png

                        J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 7 Jul 2022, 07:11 last edited by
                        #11

                        @rollyng Please, the Qt version mentioned in "About Qt Creator" dialog only tells what Qt version was used to build QtCreator, not what Qt version you're using to build your app!

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          rollyng
                          wrote on 7 Jul 2022, 15:40 last edited by
                          #12

                          2022-07-07-233556_1920x1080_scrot.png

                          Sorry folks, please take a look. Thanks

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 7 Jul 2022, 17:49 last edited by
                            #13

                            Depending on your application goal, you can use a custom GStreamer pipeline.

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

                            R 1 Reply Last reply 8 Jul 2022, 00:46
                            0
                            • S SGaist
                              7 Jul 2022, 17:49

                              Depending on your application goal, you can use a custom GStreamer pipeline.

                              R Offline
                              R Offline
                              rollyng
                              wrote on 8 Jul 2022, 00:46 last edited by
                              #14

                              @SGaist said in Any example to use libcamera for Qt5 desktop application?:

                              Depending on your application goal, you can use a custom GStreamer pipeline.

                              Hi SGaist, I would like to show the real-time image in a Qt application for preview. May I know how can I modify the camera example to do that? How can I add the GStreamer pipeline to the camera example? Thank you.

                              1 Reply Last reply
                              0
                              • R Offline
                                R Offline
                                rollyng
                                wrote on 8 Jul 2022, 06:42 last edited by
                                #15

                                Hi SGaist,
                                I have also take a look at the libcamera examples. There is the "qcam" code which made use of Qt but it is not a GUI application from my understanding.
                                link text
                                Do you suggest that I can implement the "qcam" example into Qt Creator for my application? How can I start with such?
                                Thanks,
                                rolly

                                1 Reply Last reply
                                0
                                • J Online
                                  J Online
                                  JoeCFD
                                  wrote on 8 Jul 2022, 13:42 last edited by JoeCFD 7 Aug 2022, 13:44
                                  #16

                                  You can try to use qt gstreamer to add your pipeline. Gstreamer with lower versions has pretty large memory leaks when camera is switched. If you do not switch camera often, it is ok. But it is better to install 1.20 or above in your machine. Build Qt Gstreamer with Qt 5.15.2 and higher version of gstreamer. Qt gstreamer has some examples for how to make pipelines. If you have any issues in build, post them here.

                                  https://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/annotated.html

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 8 Jul 2022, 18:22 last edited by
                                    #17

                                    If memory serves well, Qt Creator has support for meson however yours might be too old.

                                    Otherwise you can generate a minimal .pro file using qmake -project.

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

                                    R 1 Reply Last reply 9 Jul 2022, 18:03
                                    0
                                    • S SGaist
                                      8 Jul 2022, 18:22

                                      If memory serves well, Qt Creator has support for meson however yours might be too old.

                                      Otherwise you can generate a minimal .pro file using qmake -project.

                                      R Offline
                                      R Offline
                                      rollyng
                                      wrote on 9 Jul 2022, 18:03 last edited by
                                      #18

                                      @SGaist said in Any example to use libcamera for Qt5 desktop application?:

                                      If memory serves well, Qt Creator has support for meson however yours might be too old.

                                      Otherwise you can generate a minimal .pro file using qmake -project.

                                      Hi SGaist, thank you and I did that. Now I can open the libcamera project in Qt Creator. But some of the Qt include definitions are missing? Please take a look.
                                      #include <QComboBox> for example?

                                      By the way, How can I build and run qcam in Qt Creator? Simple compilation failed at once.

                                      02:00:30: Running steps for project libcamera...
                                      02:00:30: Starting: "/usr/lib/qt5/bin/qmake" /home/pi/code/libcamera/libcamera.pro -spec linux-g++ CONFIG+=qtquickcompiler
                                      Info: creating stash file /home/pi/code/build-libcamera-Desktop-Release/.qmake.stash
                                      02:00:31: The process "/usr/lib/qt5/bin/qmake" exited normally.
                                      02:00:31: Starting: "/usr/bin/make" -f /home/pi/code/build-libcamera-Desktop-Release/Makefile qmake_all
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1750: warning: overriding recipe for target 'main.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1674: warning: ignoring old recipe for target 'main.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1793: warning: overriding recipe for target 'delayed_controls.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1476: warning: ignoring old recipe for target 'delayed_controls.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1805: warning: overriding recipe for target 'fence.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1488: warning: ignoring old recipe for target 'fence.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1817: warning: overriding recipe for target 'geometry.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1497: warning: ignoring old recipe for target 'geometry.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1912: warning: overriding recipe for target 'main.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1750: warning: ignoring old recipe for target 'main.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2078: warning: overriding recipe for target 'controls.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1790: warning: ignoring old recipe for target 'controls.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2087: warning: overriding recipe for target 'formats.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1808: warning: ignoring old recipe for target 'formats.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2106: warning: overriding recipe for target 'camera3_hal.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1563: warning: ignoring old recipe for target 'camera3_hal.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2133: warning: overriding recipe for target 'camera_metadata.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1597: warning: ignoring old recipe for target 'camera_metadata.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2270: warning: overriding recipe for target 'ipa_context.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2171: warning: ignoring old recipe for target 'ipa_context.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2301: warning: overriding recipe for target 'file.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1491: warning: ignoring old recipe for target 'file.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2304: warning: overriding recipe for target 'flags.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1494: warning: ignoring old recipe for target 'flags.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2310: warning: overriding recipe for target 'message.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1506: warning: ignoring old recipe for target 'message.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2316: warning: overriding recipe for target 'object.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1515: warning: ignoring old recipe for target 'object.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2325: warning: overriding recipe for target 'signal.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1530: warning: ignoring old recipe for target 'signal.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2331: warning: overriding recipe for target 'timer.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1542: warning: ignoring old recipe for target 'timer.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2337: warning: overriding recipe for target 'utils.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:1548: warning: ignoring old recipe for target 'utils.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2382: warning: overriding recipe for target 'algorithm.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2182: warning: ignoring old recipe for target 'algorithm.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2395: warning: overriding recipe for target 'histogram.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2188: warning: ignoring old recipe for target 'histogram.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2402: warning: overriding recipe for target 'agc.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2363: warning: ignoring old recipe for target 'agc.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2406: warning: overriding recipe for target 'awb.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2367: warning: ignoring old recipe for target 'awb.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2410: warning: overriding recipe for target 'blc.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2371: warning: ignoring old recipe for target 'blc.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2424: warning: overriding recipe for target 'ipu3.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2179: warning: ignoring old recipe for target 'ipu3.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2431: warning: overriding recipe for target 'raspberrypi.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2267: warning: ignoring old recipe for target 'raspberrypi.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2437: warning: overriding recipe for target 'rkisp1.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2277: warning: ignoring old recipe for target 'rkisp1.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2452: warning: overriding recipe for target 'vimc.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2280: warning: ignoring old recipe for target 'vimc.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2466: warning: overriding recipe for target 'agc.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2402: warning: ignoring old recipe for target 'agc.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2488: warning: overriding recipe for target 'awb.o'
                                      /home/pi/code/build-libcamera-Desktop-Release/Makefile:2406: warning: ignoring old recipe for target 'awb.o'
                                      make: Nothing to be done for 'qmake_all'.
                                      02:00:31: The process "/usr/bin/make" exited normally.
                                      02:00:31: Starting: "/usr/bin/make" -j4
                                      Makefile:1750: warning: overriding recipe for target 'main.o'
                                      Makefile:1674: warning: ignoring old recipe for target 'main.o'
                                      Makefile:1793: warning: overriding recipe for target 'delayed_controls.o'
                                      Makefile:1476: warning: ignoring old recipe for target 'delayed_controls.o'
                                      Makefile:1805: warning: overriding recipe for target 'fence.o'
                                      Makefile:1488: warning: ignoring old recipe for target 'fence.o'
                                      Makefile:1817: warning: overriding recipe for target 'geometry.o'
                                      Makefile:1497: warning: ignoring old recipe for target 'geometry.o'
                                      Makefile:1912: warning: overriding recipe for target 'main.o'
                                      Makefile:1750: warning: ignoring old recipe for target 'main.o'
                                      Makefile:2078: warning: overriding recipe for target 'controls.o'
                                      Makefile:1790: warning: ignoring old recipe for target 'controls.o'
                                      Makefile:2087: warning: overriding recipe for target 'formats.o'
                                      Makefile:1808: warning: ignoring old recipe for target 'formats.o'
                                      Makefile:2106: warning: overriding recipe for target 'camera3_hal.o'
                                      Makefile:1563: warning: ignoring old recipe for target 'camera3_hal.o'
                                      Makefile:2133: warning: overriding recipe for target 'camera_metadata.o'
                                      Makefile:1597: warning: ignoring old recipe for target 'camera_metadata.o'
                                      Makefile:2270: warning: overriding recipe for target 'ipa_context.o'
                                      Makefile:2171: warning: ignoring old recipe for target 'ipa_context.o'
                                      Makefile:2301: warning: overriding recipe for target 'file.o'
                                      Makefile:1491: warning: ignoring old recipe for target 'file.o'
                                      Makefile:2304: warning: overriding recipe for target 'flags.o'
                                      Makefile:1494: warning: ignoring old recipe for target 'flags.o'
                                      Makefile:2310: warning: overriding recipe for target 'message.o'
                                      Makefile:1506: warning: ignoring old recipe for target 'message.o'
                                      Makefile:2316: warning: overriding recipe for target 'object.o'
                                      Makefile:1515: warning: ignoring old recipe for target 'object.o'
                                      Makefile:2325: warning: overriding recipe for target 'signal.o'
                                      Makefile:1530: warning: ignoring old recipe for target 'signal.o'
                                      Makefile:2331: warning: overriding recipe for target 'timer.o'
                                      Makefile:1542: warning: ignoring old recipe for target 'timer.o'
                                      Makefile:2337: warning: overriding recipe for target 'utils.o'
                                      Makefile:1548: warning: ignoring old recipe for target 'utils.o'
                                      Makefile:2382: warning: overriding recipe for target 'algorithm.o'
                                      Makefile:2182: warning: ignoring old recipe for target 'algorithm.o'
                                      Makefile:2395: warning: overriding recipe for target 'histogram.o'
                                      Makefile:2188: warning: ignoring old recipe for target 'histogram.o'
                                      Makefile:2402: warning: overriding recipe for target 'agc.o'
                                      Makefile:2363: warning: ignoring old recipe for target 'agc.o'
                                      Makefile:2406: warning: overriding recipe for target 'awb.o'
                                      Makefile:2367: warning: ignoring old recipe for target 'awb.o'
                                      Makefile:2410: warning: overriding recipe for target 'blc.o'
                                      Makefile:2371: warning: ignoring old recipe for target 'blc.o'
                                      Makefile:2424: warning: overriding recipe for target 'ipu3.o'
                                      Makefile:2179: warning: ignoring old recipe for target 'ipu3.o'
                                      Makefile:2431: warning: overriding recipe for target 'raspberrypi.o'
                                      Makefile:2267: warning: ignoring old recipe for target 'raspberrypi.o'
                                      Makefile:2437: warning: overriding recipe for target 'rkisp1.o'
                                      Makefile:2277: warning: ignoring old recipe for target 'rkisp1.o'
                                      Makefile:2452: warning: overriding recipe for target 'vimc.o'
                                      Makefile:2280: warning: ignoring old recipe for target 'vimc.o'
                                      Makefile:2466: warning: overriding recipe for target 'agc.o'
                                      Makefile:2402: warning: ignoring old recipe for target 'agc.o'
                                      Makefile:2488: warning: overriding recipe for target 'awb.o'
                                      Makefile:2406: warning: ignoring old recipe for target 'awb.o'
                                      g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../libcamera -I. -I../libcamera -I/usr/include/aarch64-linux-gnu/qt5 -I/usr/include/aarch64-linux-gnu/qt5/QtGui -I/usr/include/aarch64-linux-gnu/qt5/QtCore -I. -I/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -o bayer-format.o ../libcamera/test/bayer-format.cpp
                                      g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../libcamera -I. -I../libcamera -I/usr/include/aarch64-linux-gnu/qt5 -I/usr/include/aarch64-linux-gnu/qt5/QtGui -I/usr/include/aarch64-linux-gnu/qt5/QtCore -I. -I/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -o byte-stream-buffer.o ../libcamera/test/byte-stream-buffer.cpp
                                      g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../libcamera -I. -I../libcamera -I/usr/include/aarch64-linux-gnu/qt5 -I/usr/include/aarch64-linux-gnu/qt5/QtGui -I/usr/include/aarch64-linux-gnu/qt5/QtCore -I. -I/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -o camera-sensor.o ../libcamera/test/camera-sensor.cpp
                                      g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../libcamera -I. -I../libcamera -I/usr/include/aarch64-linux-gnu/qt5 -I/usr/include/aarch64-linux-gnu/qt5/QtGui -I/usr/include/aarch64-linux-gnu/qt5/QtCore -I. -I/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -o delayed_controls.o ../libcamera/src/libcamera/delayed_controls.cpp
                                      ../libcamera/src/libcamera/delayed_controls.cpp:8:10: fatal error: libcamera/internal/delayed_controls.h: No such file or directory
                                      8 | #include "libcamera/internal/delayed_controls.h"
                                      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                      compilation terminated.
                                      make: *** [Makefile:1793: delayed_controls.o] Error 1
                                      make: *** Waiting for unfinished jobs....
                                      ../libcamera/test/bayer-format.cpp:10:10: fatal error: libcamera/transform.h: No such file or directory
                                      10 | #include <libcamera/transform.h>
                                      | ^~~~~~~~~~~~~~~~~~~~~~~
                                      compilation terminated.
                                      make: *** [Makefile:1467: bayer-format.o] Error 1
                                      ../libcamera/test/camera-sensor.cpp:13:10: fatal error: libcamera/base/utils.h: No such file or directory
                                      13 | #include <libcamera/base/utils.h>
                                      | ^~~~~~~~~~~~~~~~~~~~~~~~
                                      compilation terminated.
                                      make: *** [Makefile:1473: camera-sensor.o] Error 1
                                      ../libcamera/test/byte-stream-buffer.cpp:11:10: fatal error: libcamera/internal/byte_stream_buffer.h: No such file or directory
                                      11 | #include "libcamera/internal/byte_stream_buffer.h"
                                      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                      compilation terminated.
                                      make: *** [Makefile:1470: byte-stream-buffer.o] Error 1
                                      02:00:32: The process "/usr/bin/make" exited with code 2.
                                      Error while building/deploying project libcamera (kit: Desktop)
                                      When executing step "Make"
                                      02:00:32: Elapsed time: 00:02.

                                      2022-07-10-015613_2560x1440_scrot.png

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on 9 Jul 2022, 18:37 last edited by
                                        #19

                                        The -project options does not do deep dependencies inspection. You need to add the modules your project uses. In your case, the widgets module.

                                        As for the rest, check the meson project and pick there the paths you need for the includes, librairies, etc.

                                        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
                                        1
                                        • R Offline
                                          R Offline
                                          rollyng
                                          wrote on 10 Jul 2022, 04:43 last edited by rollyng 7 Oct 2022, 12:28
                                          #20

                                          @SGaist said in Any example to use libcamera for Qt5 desktop application?:

                                          widgets module

                                          Hi SGaist, Thank you and I add the widgets and include path to the libcamera.pro file. I can see the missing header files are now found. But I have the private header error, and I have no idea how to resolve these. Please take a look. Thank you!2022-07-10-123925_2560x1440_scrot.png

                                          I believe it only necessary to build the "qcam" example in Qt Creator for my purpose, so I copy "qcam" and did some modification to the qcam.pro file. But it seems unable to resolve the declaration in its own folder? as it failed to find DNGWriter which is declared in the dng_writer.h? 2022-07-10-202425_2560x1440_scrot.png

                                          1 Reply Last reply
                                          0

                                          7/29

                                          6 Jul 2022, 01:41

                                          topic:navigator.unread, 22
                                          • Login

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