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. CameraBin error: "Failed to allocate required memory." with QCamera
Forum Updated to NodeBB v4.3 + New Features

CameraBin error: "Failed to allocate required memory." with QCamera

Scheduled Pinned Locked Moved Solved Mobile and Embedded
18 Posts 3 Posters 4.1k Views 2 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.
  • P p1ng

    With libcamera-still i can see the preview and control the camera but
    this happens when i run multimediawidgets/camera example application
    CameraBin error: "Failed to allocate required memory."

    Hardware:
    Raspberry Pi 4
    8GB Compute Module 4
    CamArray Hat with four 64MB hawkeye autofocus cameras connected
    SKU: MBS-SES-256
    GTIN: 0618455044205
    purchase link https://www.mybotshop.de/ArduCam-64MP-Autofocus-Quad-Camera-Kit-for-Raspberry-Pi_1

    Software:
    Linux raspberrypi 5.10.92-v7l+ #1514 SMP Mon Jan 17 17:38:03 GMT 2022 armv7l GNU/Linux
    Qt 5.15.2

    More info:
    pi@raspberrypi:~ $ libcamera-still --list-cameras
    Available cameras

    0 : arducam_64mp [9248x6944] (/base/soc/i2c0mux/i2c@0/arducam_64mp@1a)
    Modes: 'SRGGB10_CSI2P' : 1280x720 [120.03 fps - (2064, 2032)/5120x2880 crop]
    1920x1080 [60.04 fps - (784, 1312)/7680x4320 crop]
    2312x1736 [30.00 fps - (0, 0)/9248x6944 crop]
    3840x2160 [20.00 fps - (784, 1312)/7680x4320 crop]
    4624x3472 [10.00 fps - (0, 0)/9248x6944 crop]
    9152x6944 [2.70 fps - (0, 0)/9152x6944 crop]

    pi@raspberrypi:~ $ dmesg | grep arducam
    [ 9.034734] arducam_64mp: loading out-of-tree module taints kernel.
    [ 9.048257] arducam_64mp 0-001a: Device found Arducam 64MP.
    [ 9.048751] arducam_64mp 0-001a: Consider updating driver arducam_64mp to match on endpoints
    [ 9.059052] arducam_64mp 10-001a: failed to read chip id 682, with error -5
    [ 9.059883] arducam_64mp: probe of 10-001a failed with error -5

    pi@raspberrypi:~ $ df
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/root 7187728 5195536 1644816 76% /
    devtmpfs 752644 0 752644 0% /dev
    tmpfs 958468 43300 915168 5% /dev/shm
    tmpfs 383388 1296 382092 1% /run
    tmpfs 5120 4 5116 1% /run/lock
    /dev/mmcblk0p1 258095 49445 208651 20% /boot
    tmpfs 191692 28 191664 1% /run/user/1000

    Any ideas how to fix this?

    P Offline
    P Offline
    p1ng
    wrote on last edited by
    #2

    os boots from CM4 that has 2GB of RAM if it is of any relevance.

    P 1 Reply Last reply
    0
    • P p1ng

      os boots from CM4 that has 2GB of RAM if it is of any relevance.

      P Offline
      P Offline
      p1ng
      wrote on last edited by
      #3

      @p1ng seems that the problem is with gstreamer v4l2 drivers as qcamera is using it and standalone gsteramer doesent work either.
      the bug appears to have recently been fixed with 1.22.1 build at https://gstreamer.freedesktop.org/

      v4l2h264dec: Fix Raspberry Pi4 will not play video in application

      but i have yet no idea how to install that 1.22.1 version. the one i get with apt-get is 1.18

      any help?

      SGaistS 1 Reply Last reply
      0
      • P p1ng

        @p1ng seems that the problem is with gstreamer v4l2 drivers as qcamera is using it and standalone gsteramer doesent work either.
        the bug appears to have recently been fixed with 1.22.1 build at https://gstreamer.freedesktop.org/

        v4l2h264dec: Fix Raspberry Pi4 will not play video in application

        but i have yet no idea how to install that 1.22.1 version. the one i get with apt-get is 1.18

        any help?

        SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @p1ng hi and welcome to devnet,

        The hardcore way is to build that version of GStreamer yourself.

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

        P 1 Reply Last reply
        0
        • SGaistS SGaist

          @p1ng hi and welcome to devnet,

          The hardcore way is to build that version of GStreamer yourself.

          P Offline
          P Offline
          p1ng
          wrote on last edited by p1ng
          #5

          @SGaist I found the instructions about how to build qstreamer 1.22.1 here
          https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/1.22.1
          Currently following the instructions and have build running.
          Also for others that might have the same issue: I had to get the 1.22.1 source code from https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.22.1/gstreamer-1.22.1.tar.gz
          because what i checkout from git didnt compile for some reason. Also compilation does not work with gcc7 but seems to work with gcc11 so make sure u dont have gcc7 in alternatives.

          Do I also need to rebuild qt from source for this fix to get into the qt apps im developing as the gstreamer is part of the libqt5multimedia5-plugins?

          "Building the Qt5 QML plugin
          If qmake is not in PATH and pkgconfig files are not available, you can
          point the QMAKE env var to the Qt5 installation of your choosing before
          running meson as shown above.
          The plugin will be automatically enabled if possible, but you can ensure that
          it is built by passing -Dgood=enabled -Dgst-plugins-good:qt5=enabled to meson."

          can anybody write me specific command line commands that i have to in this step?
          i checked qmake is not in my PATH
          devasus@devasus:~/Desktop/gstreamer-1.22.1$ echo $PATH
          /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

          but when i just write $ qmake in terminal then it finds the qmake
          which qmake
          /usr/bin/qmake

          "you can
          point the QMAKE env var to the Qt5 installation of your choosing before
          running meson as shown above."

          How do I do that? do i have to add somethign to the path like
          export PATH=/Qt5.14.2/5.14.2/gcc_64/bin:$PATH

          Im confused

          P 1 Reply Last reply
          0
          • P p1ng

            @SGaist I found the instructions about how to build qstreamer 1.22.1 here
            https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/1.22.1
            Currently following the instructions and have build running.
            Also for others that might have the same issue: I had to get the 1.22.1 source code from https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.22.1/gstreamer-1.22.1.tar.gz
            because what i checkout from git didnt compile for some reason. Also compilation does not work with gcc7 but seems to work with gcc11 so make sure u dont have gcc7 in alternatives.

            Do I also need to rebuild qt from source for this fix to get into the qt apps im developing as the gstreamer is part of the libqt5multimedia5-plugins?

            "Building the Qt5 QML plugin
            If qmake is not in PATH and pkgconfig files are not available, you can
            point the QMAKE env var to the Qt5 installation of your choosing before
            running meson as shown above.
            The plugin will be automatically enabled if possible, but you can ensure that
            it is built by passing -Dgood=enabled -Dgst-plugins-good:qt5=enabled to meson."

            can anybody write me specific command line commands that i have to in this step?
            i checked qmake is not in my PATH
            devasus@devasus:~/Desktop/gstreamer-1.22.1$ echo $PATH
            /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

            but when i just write $ qmake in terminal then it finds the qmake
            which qmake
            /usr/bin/qmake

            "you can
            point the QMAKE env var to the Qt5 installation of your choosing before
            running meson as shown above."

            How do I do that? do i have to add somethign to the path like
            export PATH=/Qt5.14.2/5.14.2/gcc_64/bin:$PATH

            Im confused

            P Offline
            P Offline
            p1ng
            wrote on last edited by p1ng
            #6

            @p1ng i suppose these are the libraries that i need to compile from source and install?

            https://packages.debian.org/source/stretch/qt-gstreamer
            https://launchpad.net/ubuntu/+source/qt-gstreamer

            is that correct? and do they get compiled when i compile entire qt from source?

            when could I expect the qt-gstreamer 1.22.1 be included in the binary in the package repository for Raspberry Pi OS? so I can install it with
            sudo apt-get install libqt5multimedia5-plugins
            sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamermm-1.0-dev

            I found the qt-gstreamer source code also. Do I need to build this as well?
            https://gstreamer.freedesktop.org/data/src/qt-gstreamer/

            I am currently in the process of building the binaries, if Im successful is it possible for me to uplaod them to apt package repository so that they will be available for everyone?

            SGaistS 1 Reply Last reply
            0
            • P p1ng

              @p1ng i suppose these are the libraries that i need to compile from source and install?

              https://packages.debian.org/source/stretch/qt-gstreamer
              https://launchpad.net/ubuntu/+source/qt-gstreamer

              is that correct? and do they get compiled when i compile entire qt from source?

              when could I expect the qt-gstreamer 1.22.1 be included in the binary in the package repository for Raspberry Pi OS? so I can install it with
              sudo apt-get install libqt5multimedia5-plugins
              sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamermm-1.0-dev

              I found the qt-gstreamer source code also. Do I need to build this as well?
              https://gstreamer.freedesktop.org/data/src/qt-gstreamer/

              I am currently in the process of building the binaries, if Im successful is it possible for me to uplaod them to apt package repository so that they will be available for everyone?

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #7

              QtGStreamer is an obsolete and independent package that has nothing to do with QtMultimedia. You can ignore it.

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

              P 1 Reply Last reply
              1
              • SGaistS SGaist

                QtGStreamer is an obsolete and independent package that has nothing to do with QtMultimedia. You can ignore it.

                P Offline
                P Offline
                p1ng
                wrote on last edited by
                #8

                @SGaist I see. Yes i just checked dependencies
                henri@henri-MS-7A72:~$ apt-cache depends libqt5multimedia5-plugins
                libqt5multimedia5-plugins
                Depends: libqt5multimedia5
                Depends: libasound2
                Depends: libc6
                Depends: libglib2.0-0
                Depends: libgstreamer-plugins-base1.0-0
                Depends: libgstreamer1.0-0
                Depends: libpulse0
                Depends: libqt5core5a
                |Depends: libqt5gui5
                Depends: libqt5gui5-gles
                Depends: libqt5multimediagsttools5
                Depends: libqt5network5
                Depends: libstdc++6

                This means i have to

                1. Remove libraries
                  sudo apt-get remove libqt5multimedia5-plugins
                  sudo apt-get remove libgstreamer1.0 libgstreamer-plugins-base1.0 libgstreamermm-1.0
                  just in case
                  sudo apt-get remove libgstreamer1.0 libgstreamer-plugins-base1.0-dev libgstreamermm-1.0

                2. Build and install gstreamer 1.22.1 from source following this guide in README:
                  https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/1.22.1

                3. Install the libq5multimedia5-plugins again
                  sudo apt-get install libqt5multimedia5-plugins

                4. Cross my fingers and pray

                Is this correct?

                P 1 Reply Last reply
                0
                • P p1ng

                  @SGaist I see. Yes i just checked dependencies
                  henri@henri-MS-7A72:~$ apt-cache depends libqt5multimedia5-plugins
                  libqt5multimedia5-plugins
                  Depends: libqt5multimedia5
                  Depends: libasound2
                  Depends: libc6
                  Depends: libglib2.0-0
                  Depends: libgstreamer-plugins-base1.0-0
                  Depends: libgstreamer1.0-0
                  Depends: libpulse0
                  Depends: libqt5core5a
                  |Depends: libqt5gui5
                  Depends: libqt5gui5-gles
                  Depends: libqt5multimediagsttools5
                  Depends: libqt5network5
                  Depends: libstdc++6

                  This means i have to

                  1. Remove libraries
                    sudo apt-get remove libqt5multimedia5-plugins
                    sudo apt-get remove libgstreamer1.0 libgstreamer-plugins-base1.0 libgstreamermm-1.0
                    just in case
                    sudo apt-get remove libgstreamer1.0 libgstreamer-plugins-base1.0-dev libgstreamermm-1.0

                  2. Build and install gstreamer 1.22.1 from source following this guide in README:
                    https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/1.22.1

                  3. Install the libq5multimedia5-plugins again
                    sudo apt-get install libqt5multimedia5-plugins

                  4. Cross my fingers and pray

                  Is this correct?

                  P Offline
                  P Offline
                  p1ng
                  wrote on last edited by
                  #9

                  So this is where im at right now

                  sudo apt-get remove libqt5multimedia5-plugins
                  sudo apt-get remove libgstreamer1.0 libgstreamer-plugins-base1.0 libgstreamermm-1.0

                  Just in case

                  sudo apt-get remove libgstreamer*

                  VERY IMPORTNANT TO INSTALL meson as root otherwise will get build issue

                  $sudo pip3 install meson
                  $sudo pip3 install markdow typogrify
                  $sudo apt-get update
                  $sudo apt-get install ninja-build
                  $sudo apt install -y build-essential autotools-dev automake autoconf
                  libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev
                  pkg-config bison flex python3 git gtk-doc-tools libasound2-dev
                  libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev
                  libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes
                  libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev
                  libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev
                  libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev
                  libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev
                  libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev
                  libcurl4-gnutls-dev libdca-dev libdvdnav-dev \

                  Make sure to get the tarball because checkout out 1.22.1 tag from git gave me problems i could not resolve.

                  $wget https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.21.1/gstreamer-1.21.1.tar.gz
                  $tar -xf gstreamer-1.21.1.tar.gz
                  $cd gstreamer-1.21.1.tar.gz

                  FFmpeg didnt compile on my RPI4 (32-it OS), so to disable it cause got some ARMv proessor arhcitecture errors.

                  $meson builddir -Dgst-plugins-base:gl_winsys=egl -Dlibav=disabled
                  $ninja -C builddir
                  $meson setup builddir
                  $meson compile -C buildir

                  $sudo meson install -C builddir$ gst-launch-1.0 --version
                  gst-launch-1.0: error while loading shared libraries: libgstreamer-1.0.so.0: cannot open shared object file: No such file or directory

                  $sudo gedit /etc/ld.so.conf.d/randomLibs.conf
                  #add this line to the file or if the ibgstreamer-1.0.so.0 was installed somewhere else add that path
                  /usr/local/lib/arm-linux-gnueabihf
                  sudo ldconfig

                  $gst-launch-1.0 --version
                  gst-launch-1.0 version 1.21.1
                  GStreamer 1.21.1
                  Unknown package origin

                  When i try to run my app that uses QCamera this is the error i get:

                  Error: cannot create camera service, the 'camerabin' plugin is missing for GStreamer 1.18.
                  Please install the 'bad' GStreamer plugin package.

                  I will now try to compile and install the bad plugin package with -Dbad=enabled. But im not sure if it will fix this because it seems to me that when i install sudo apt-get install qtmultimedia5-dev this will automatically install and try to use the 1.18 gstreamer - this is what i conclude from that error message.

                  P 1 Reply Last reply
                  0
                  • P p1ng

                    So this is where im at right now

                    sudo apt-get remove libqt5multimedia5-plugins
                    sudo apt-get remove libgstreamer1.0 libgstreamer-plugins-base1.0 libgstreamermm-1.0

                    Just in case

                    sudo apt-get remove libgstreamer*

                    VERY IMPORTNANT TO INSTALL meson as root otherwise will get build issue

                    $sudo pip3 install meson
                    $sudo pip3 install markdow typogrify
                    $sudo apt-get update
                    $sudo apt-get install ninja-build
                    $sudo apt install -y build-essential autotools-dev automake autoconf
                    libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev
                    pkg-config bison flex python3 git gtk-doc-tools libasound2-dev
                    libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev
                    libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes
                    libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev
                    libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev
                    libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev
                    libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev
                    libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev
                    libcurl4-gnutls-dev libdca-dev libdvdnav-dev \

                    Make sure to get the tarball because checkout out 1.22.1 tag from git gave me problems i could not resolve.

                    $wget https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.21.1/gstreamer-1.21.1.tar.gz
                    $tar -xf gstreamer-1.21.1.tar.gz
                    $cd gstreamer-1.21.1.tar.gz

                    FFmpeg didnt compile on my RPI4 (32-it OS), so to disable it cause got some ARMv proessor arhcitecture errors.

                    $meson builddir -Dgst-plugins-base:gl_winsys=egl -Dlibav=disabled
                    $ninja -C builddir
                    $meson setup builddir
                    $meson compile -C buildir

                    $sudo meson install -C builddir$ gst-launch-1.0 --version
                    gst-launch-1.0: error while loading shared libraries: libgstreamer-1.0.so.0: cannot open shared object file: No such file or directory

                    $sudo gedit /etc/ld.so.conf.d/randomLibs.conf
                    #add this line to the file or if the ibgstreamer-1.0.so.0 was installed somewhere else add that path
                    /usr/local/lib/arm-linux-gnueabihf
                    sudo ldconfig

                    $gst-launch-1.0 --version
                    gst-launch-1.0 version 1.21.1
                    GStreamer 1.21.1
                    Unknown package origin

                    When i try to run my app that uses QCamera this is the error i get:

                    Error: cannot create camera service, the 'camerabin' plugin is missing for GStreamer 1.18.
                    Please install the 'bad' GStreamer plugin package.

                    I will now try to compile and install the bad plugin package with -Dbad=enabled. But im not sure if it will fix this because it seems to me that when i install sudo apt-get install qtmultimedia5-dev this will automatically install and try to use the 1.18 gstreamer - this is what i conclude from that error message.

                    P Offline
                    P Offline
                    p1ng
                    wrote on last edited by
                    #10

                    $meson builddir --reconfigure -Dbad=enabled -Dgst-plugins-base:gl_winsys=egl,wayland -Dlibav=disabled -Dgst-plugins-bad:camerabin2=enabled
                    $meson compile -C builddir
                    $meson install -C builddir

                    And now my QCamera cant even detect the camera....

                    Can you reccommend me some other class I could use for this camera? I see some people have used the qcam code from lib-camera. Anybody have a working project setup with that code?

                    All i need is to have the cameras to be able to capture pictures and control zoom from my Qt application.

                    P 1 Reply Last reply
                    0
                    • P p1ng

                      $meson builddir --reconfigure -Dbad=enabled -Dgst-plugins-base:gl_winsys=egl,wayland -Dlibav=disabled -Dgst-plugins-bad:camerabin2=enabled
                      $meson compile -C builddir
                      $meson install -C builddir

                      And now my QCamera cant even detect the camera....

                      Can you reccommend me some other class I could use for this camera? I see some people have used the qcam code from lib-camera. Anybody have a working project setup with that code?

                      All i need is to have the cameras to be able to capture pictures and control zoom from my Qt application.

                      P Offline
                      P Offline
                      p1ng
                      wrote on last edited by
                      #11

                      @p1ng
                      So I just found out that the fix in gstreamer 1.22.1 that makes camera work with Qt is just one line in gstreamer source code. What i will try next is to check out gstreamer 1.18 source code, put that fix in it, compile and install since my qt app was able to reqonize camera when gstreamer 1.18 was installed. This is the fix if im not mistaken: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/67df248270491116af6099bf3bec5c740dfe3042
                      67df2482
                      v4l2h264dec: Fix Raspberry Pi4 will not play video in application

                      and if that doesent work ill probably try to use qcam source from libcamera examples instead of QCamera

                      P 1 Reply Last reply
                      0
                      • P p1ng

                        @p1ng
                        So I just found out that the fix in gstreamer 1.22.1 that makes camera work with Qt is just one line in gstreamer source code. What i will try next is to check out gstreamer 1.18 source code, put that fix in it, compile and install since my qt app was able to reqonize camera when gstreamer 1.18 was installed. This is the fix if im not mistaken: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/67df248270491116af6099bf3bec5c740dfe3042
                        67df2482
                        v4l2h264dec: Fix Raspberry Pi4 will not play video in application

                        and if that doesent work ill probably try to use qcam source from libcamera examples instead of QCamera

                        P Offline
                        P Offline
                        p1ng
                        wrote on last edited by p1ng
                        #12

                        That didnt work out.

                        # On my Ubuntu 22.04 PC
                        wget https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2022-01-28/2022-01-28-raspios-bullseye-armhf.zip
                        git clone https://github.com/raspberrypi/usbboot.git
                        cd usbboot
                        # Flip the BOOT switch on RPI to ON
                        sudo ./rpiboot
                        wget https://github.com/balena-io/etcher/releases/download/v1.18.4/balenaEtcher-1.18.4-x64.AppImage
                        chmod +x balenaEtcher-1.18.4-x64.AppImage
                        ./balenaEtcher-1.18.4-x64.AppImage
                        # Flashed to my RPi4 CM4
                        
                        
                        # On my RPI4 CM4
                        wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
                        chmod +x install_pivariety_pkgs.sh
                        2. Install libcamra-dev
                        ./install_pivariety_pkgs.sh -p libcamera_dev
                        3. Install libcamera-apps
                        ./install_pivariety_pkgs.sh -p libcamera_apps
                        4. Install the kernel driver
                        ./install_pivariety_pkgs.sh -p 64mp_pi_hawk_eye_kernel_driver
                        5. Configuration
                        Open /boot/config.txt, under [all], add the following line:
                        dtoverlay=vc4-kms-v3d,cma-512
                        Example:
                        [all]
                        # Run as fast as firmware / board allows
                        arm_boost=1
                        dtoverlay=vc4-kms-v3d,cma-512
                        # Enabled i2c under interfaces
                        sudo raspi-config
                        reboot
                        
                        # Compiling gstreamer 1.18
                        sudo pip3 install meson
                        sudo apt-get update
                        # have to use gst-build for v<19 https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-meson.html?gi-language=c
                        git clone https://gitlab.freedesktop.org/gstreamer/gst-build.git
                        cd gst-build
                        $sudo apt install -y  build-essential autotools-dev automake autoconf \
                                                            libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev \
                                                            pkg-config bison flex python3 git gtk-doc-tools libasound2-dev \
                                                            libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev \
                                                            libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes \
                                                            libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev \
                        									libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev \
                                                            libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev \
                                                            libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev \
                                                            libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev \
                                                            libcurl4-gnutls-dev libdca-dev libdvdnav-dev \
                        meson build --buildtype=release -Dgst-plugins-good:qt5=disabled -Dbad=enabled -Dgst-plugins-base:gl_winsys=egl -Dlibav=disabled -Dgst-plugins-bad:camerabin2=enabled
                        
                        # At this point i installed gstreamer tools to see if standalone gstreamer tools will play my cameras
                        # install a missing dependency
                        $ sudo apt-get install libx264-dev libjpeg-dev
                        # install the remaining plugins
                        $ sudo apt-get install libgstreamer1.0-dev \
                             libgstreamer-plugins-base1.0-dev \
                             libgstreamer-plugins-bad1.0-dev \
                             gstreamer1.0-plugins-ugly \
                             gstreamer1.0-tools \
                             gstreamer1.0-gl \
                             gstreamer1.0-gtk3 
                        
                        # Confirmed that current standalone gsteamer plays video. 
                        gst-launch-1.0 libcamerasrc ! video/x-raw, width=640, height=480, framerate=30/1 ! videoconvert ! videoscale ! clockoverlay time-format="%D %H:%M:%S" ! autovideosink
                        
                        # This made me curious to install qt and try to run camera example project to confirm it dosent work before i try to compile & install the 1.18.6 version
                        sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools 
                        sudo apt-get install cmake
                        sudo apt-get install clan
                        sudo apt-get install qtmultimedia5-dev 
                        sudo apt-get install qtcreator
                        ~/Qt/5.14.2/Examples/Qt-5.14.2$ scp -r multimediawidgets pi@192.168.88.249:/home/pi/Desktop/Examples
                        ~/Qt/5.14.2/Examples/Qt-5.14.2$ scp -r multimediawidgets pi@192.168.88.249:/home/pi/Desktop/multimedia
                        
                        # Built and compiled the Examples/camera in qtcreator but got error "CameraService is missing"
                        sudo apt-get install libqt5multimedia5-plugins
                        
                        # Now i get the CameraBin error: "Failed to allocate memory". So proceed with meson compilation
                        
                        # I also checked the version of different gstreamer libraries/tools i currenlty have installed
                        pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $ dpkg -l | grep gstream*
                        ii  gir1.2-gstreamer-1.0:armhf             1.18.4-2.1                       armhf        GObject introspection data for the GStreamer library
                        ii  gstreamer1.0-alsa:armhf                1.18.4-2                         armhf        GStreamer plugin for ALSA
                        ii  gstreamer1.0-gl:armhf                  1.18.4-2                         armhf        GStreamer plugins for GL
                        ii  gstreamer1.0-gtk3:armhf                1.18.4-2+deb11u1+rpt1            armhf        GStreamer plugin for GTK+3
                        ii  gstreamer1.0-libav:armhf               1.18.4-3                         armhf        ffmpeg plugin for GStreamer
                        ii  gstreamer1.0-omx                       1.0.0.1-0+rpi12+jessiepmg        armhf        GStreamer OpenMAX plugins
                        ii  gstreamer1.0-plugins-bad:armhf         1.18.4-3                         armhf        GStreamer plugins from the "bad" set
                        ii  gstreamer1.0-plugins-base:armhf        1.18.4-2                         armhf        GStreamer plugins from the "base" set
                        ii  gstreamer1.0-plugins-good:armhf        1.18.4-2                         armhf        GStreamer plugins from the "good" set
                        ii  gstreamer1.0-plugins-ugly:armhf        1.18.4-2                         armhf        GStreamer plugins from the "ugly" set
                        ii  gstreamer1.0-tools                     1.18.4-2.1                       armhf        Tools for use with GStreamer
                        ii  gstreamer1.0-x:armhf                   1.18.4-2                         armhf        GStreamer plugins for X11 and Pango
                        ii  libgstreamer-gl1.0-0:armhf             1.18.4-2                         armhf        GStreamer GL libraries
                        ii  libgstreamer-opencv1.0-0:armhf         1.18.4-3                         armhf        GStreamer OpenCV libraries
                        ii  libgstreamer-plugins-bad1.0-0:armhf    1.18.4-3                         armhf        GStreamer libraries from the "bad" set
                        ii  libgstreamer-plugins-bad1.0-dev:armhf  1.18.4-3                         armhf        GStreamer development files for libraries from the "bad" set
                        ii  libgstreamer-plugins-base1.0-0:armhf   1.18.4-2                         armhf        GStreamer libraries from the "base" set
                        ii  libgstreamer-plugins-base1.0-dev:armhf 1.18.4-2                         armhf        GStreamer development files for libraries from the "base" set
                        ii  libgstreamer1.0-0:armhf                1.18.4-2.1                       armhf        Core GStreamer libraries and elements
                        ii  libgstreamer1.0-dev:armhf              1.18.4-2.1                       armhf        GStreamer core development files
                        ii  libqt5gstreamer-1.0-0:armhf            1.2.0-5.1                        armhf        C++ bindings library for GStreamer with a Qt-style API - Qt 5 build
                        
                        pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $ apt list | grep libqt5multimedia5-plugins
                        libqt5multimedia5-plugins/stable,now 5.15.2-3 armhf [installed]
                        
                        # Compile 
                        pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $ cp subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c_backup
                        pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $ nano subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c
                        
                        #Search for method gst_v4l2_object_stop and replace it with 
                        gboolean
                        gst_v4l2_object_stop (GstV4l2Object * v4l2object)
                        {
                          GstBufferPool *pool;
                          GST_DEBUG_OBJECT (v4l2object->dbg_obj, "stopping");
                        
                          if (!GST_V4L2_IS_OPEN (v4l2object))
                            goto done;
                          if (!GST_V4L2_IS_ACTIVE (v4l2object))
                            goto done;
                        
                          pool = gst_v4l2_object_get_buffer_pool (v4l2object);
                          if (pool) {
                            if (!gst_v4l2_buffer_pool_orphan (v4l2object)) {
                              GST_DEBUG_OBJECT (v4l2object->dbg_obj, "deactivating pool");
                              gst_buffer_pool_set_active (pool, FALSE);
                        
                              {
                                GstBufferPool *old_pool;
                                GST_OBJECT_LOCK (v4l2object->element);
                                old_pool = v4l2object->pool;
                                v4l2object->pool = NULL;
                                GST_OBJECT_UNLOCK (v4l2object->element);
                                if (old_pool)
                                  gst_object_unref (old_pool);
                              }
                            }
                            gst_object_unref (pool);
                          }
                        
                          GST_V4L2_SET_INACTIVE (v4l2object);
                        
                        done:
                          return TRUE;
                        }
                        
                        # Add gst_v4l2_object_get_buffer_pool methdo to the end of the file
                        
                        GstBufferPool *
                        gst_v4l2_object_get_buffer_pool (GstV4l2Object * v4l2object)
                        {
                          GstBufferPool *ret = NULL;
                        
                          g_return_val_if_fail (v4l2object != NULL, NULL);
                        
                          GST_OBJECT_LOCK (v4l2object->element);
                          if (v4l2object->pool)
                            ret = gst_object_ref (v4l2object->pool);
                          GST_OBJECT_UNLOCK (v4l2object->element);
                        
                          return ret;
                        }
                        
                        # Add this line to subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.h at the end of /* probing */ block 
                        GstBufferPool * gst_v4l2_object_get_buffer_pool (GstV4l2Object * v4l2object);
                        
                        # Now compile gstreamer 1.18.6
                        ninja -C build
                        sudo ninja -C build install
                        
                        pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $  dpkg -l | grep gstream*
                        ii  gir1.2-gstreamer-1.0:armhf             1.18.4-2.1                       armhf        GObject introspection data for the GStreamer library
                        ii  gstreamer1.0-alsa:armhf                1.18.4-2                         armhf        GStreamer plugin for ALSA
                        ii  gstreamer1.0-gl:armhf                  1.18.4-2                         armhf        GStreamer plugins for GL
                        ii  gstreamer1.0-gtk3:armhf                1.18.4-2+deb11u1+rpt1            armhf        GStreamer plugin for GTK+3
                        ii  gstreamer1.0-libav:armhf               1.18.4-3                         armhf        ffmpeg plugin for GStreamer
                        ii  gstreamer1.0-omx                       1.0.0.1-0+rpi12+jessiepmg        armhf        GStreamer OpenMAX plugins
                        ii  gstreamer1.0-plugins-bad:armhf         1.18.4-3                         armhf        GStreamer plugins from the "bad" set
                        ii  gstreamer1.0-plugins-base:armhf        1.18.4-2                         armhf        GStreamer plugins from the "base" set
                        ii  gstreamer1.0-plugins-good:armhf        1.18.4-2                         armhf        GStreamer plugins from the "good" set
                        ii  gstreamer1.0-plugins-ugly:armhf        1.18.4-2                         armhf        GStreamer plugins from the "ugly" set
                        ii  gstreamer1.0-tools                     1.18.4-2.1                       armhf        Tools for use with GStreamer
                        ii  gstreamer1.0-x:armhf                   1.18.4-2                         armhf        GStreamer plugins for X11 and Pango
                        ii  libgstreamer-gl1.0-0:armhf             1.18.4-2                         armhf        GStreamer GL libraries
                        ii  libgstreamer-opencv1.0-0:armhf         1.18.4-3                         armhf        GStreamer OpenCV libraries
                        ii  libgstreamer-plugins-bad1.0-0:armhf    1.18.4-3                         armhf        GStreamer libraries from the "bad" set
                        ii  libgstreamer-plugins-bad1.0-dev:armhf  1.18.4-3                         armhf        GStreamer development files for libraries from the "bad" set
                        ii  libgstreamer-plugins-base1.0-0:armhf   1.18.4-2                         armhf        GStreamer libraries from the "base" set
                        ii  libgstreamer-plugins-base1.0-dev:armhf 1.18.4-2                         armhf        GStreamer development files for libraries from the "base" set
                        ii  libgstreamer1.0-0:armhf                1.18.4-2.1                       armhf        Core GStreamer libraries and elements
                        ii  libgstreamer1.0-dev:armhf              1.18.4-2.1                       armhf        GStreamer core development files
                        ii  libqt5gstreamer-1.0-0:armhf            1.2.0-5.1                        armhf        C++ bindings library for GStreamer with a Qt-style API - Qt 5 build
                        
                        # So the packages i compiled were not replace with packages from remote repo i installed with apt-get
                        sudo apt-get remove gstreamer1.0-plugins-good
                        
                        # Now when i do
                        pi@raspberrypi:~ $ gst-launch-1.0 --version
                        gst-launch-1.0 version 1.18.6
                        GStreamer 1.18.6
                        Unknown package origin
                        
                        # But after that removal the gst-launch-1.0 cant play back camera anymore. Maybe it was my "fix" in code that broke it. Ill roll that back and rebuild
                        # So what i did now is that i uninstalled everything related to gstreamer
                        sudo apt-get remove libgstreamer* libqt5gstreamer* gstreamer1.0*
                        
                        
                        

                        at this point i give up and work on some other stuff. maybe over time somebody will fix it for qt5 or ill try to use libcamera https://git.libcamera.org/libcamera/libcamera.git/tree/src/apps/qcam instead of QCamera or ill see if my camera works in qt6.

                        P 1 Reply Last reply
                        0
                        • P p1ng

                          That didnt work out.

                          # On my Ubuntu 22.04 PC
                          wget https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2022-01-28/2022-01-28-raspios-bullseye-armhf.zip
                          git clone https://github.com/raspberrypi/usbboot.git
                          cd usbboot
                          # Flip the BOOT switch on RPI to ON
                          sudo ./rpiboot
                          wget https://github.com/balena-io/etcher/releases/download/v1.18.4/balenaEtcher-1.18.4-x64.AppImage
                          chmod +x balenaEtcher-1.18.4-x64.AppImage
                          ./balenaEtcher-1.18.4-x64.AppImage
                          # Flashed to my RPi4 CM4
                          
                          
                          # On my RPI4 CM4
                          wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
                          chmod +x install_pivariety_pkgs.sh
                          2. Install libcamra-dev
                          ./install_pivariety_pkgs.sh -p libcamera_dev
                          3. Install libcamera-apps
                          ./install_pivariety_pkgs.sh -p libcamera_apps
                          4. Install the kernel driver
                          ./install_pivariety_pkgs.sh -p 64mp_pi_hawk_eye_kernel_driver
                          5. Configuration
                          Open /boot/config.txt, under [all], add the following line:
                          dtoverlay=vc4-kms-v3d,cma-512
                          Example:
                          [all]
                          # Run as fast as firmware / board allows
                          arm_boost=1
                          dtoverlay=vc4-kms-v3d,cma-512
                          # Enabled i2c under interfaces
                          sudo raspi-config
                          reboot
                          
                          # Compiling gstreamer 1.18
                          sudo pip3 install meson
                          sudo apt-get update
                          # have to use gst-build for v<19 https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-meson.html?gi-language=c
                          git clone https://gitlab.freedesktop.org/gstreamer/gst-build.git
                          cd gst-build
                          $sudo apt install -y  build-essential autotools-dev automake autoconf \
                                                              libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev \
                                                              pkg-config bison flex python3 git gtk-doc-tools libasound2-dev \
                                                              libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev \
                                                              libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes \
                                                              libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev \
                          									libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev \
                                                              libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev \
                                                              libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev \
                                                              libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev \
                                                              libcurl4-gnutls-dev libdca-dev libdvdnav-dev \
                          meson build --buildtype=release -Dgst-plugins-good:qt5=disabled -Dbad=enabled -Dgst-plugins-base:gl_winsys=egl -Dlibav=disabled -Dgst-plugins-bad:camerabin2=enabled
                          
                          # At this point i installed gstreamer tools to see if standalone gstreamer tools will play my cameras
                          # install a missing dependency
                          $ sudo apt-get install libx264-dev libjpeg-dev
                          # install the remaining plugins
                          $ sudo apt-get install libgstreamer1.0-dev \
                               libgstreamer-plugins-base1.0-dev \
                               libgstreamer-plugins-bad1.0-dev \
                               gstreamer1.0-plugins-ugly \
                               gstreamer1.0-tools \
                               gstreamer1.0-gl \
                               gstreamer1.0-gtk3 
                          
                          # Confirmed that current standalone gsteamer plays video. 
                          gst-launch-1.0 libcamerasrc ! video/x-raw, width=640, height=480, framerate=30/1 ! videoconvert ! videoscale ! clockoverlay time-format="%D %H:%M:%S" ! autovideosink
                          
                          # This made me curious to install qt and try to run camera example project to confirm it dosent work before i try to compile & install the 1.18.6 version
                          sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools 
                          sudo apt-get install cmake
                          sudo apt-get install clan
                          sudo apt-get install qtmultimedia5-dev 
                          sudo apt-get install qtcreator
                          ~/Qt/5.14.2/Examples/Qt-5.14.2$ scp -r multimediawidgets pi@192.168.88.249:/home/pi/Desktop/Examples
                          ~/Qt/5.14.2/Examples/Qt-5.14.2$ scp -r multimediawidgets pi@192.168.88.249:/home/pi/Desktop/multimedia
                          
                          # Built and compiled the Examples/camera in qtcreator but got error "CameraService is missing"
                          sudo apt-get install libqt5multimedia5-plugins
                          
                          # Now i get the CameraBin error: "Failed to allocate memory". So proceed with meson compilation
                          
                          # I also checked the version of different gstreamer libraries/tools i currenlty have installed
                          pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $ dpkg -l | grep gstream*
                          ii  gir1.2-gstreamer-1.0:armhf             1.18.4-2.1                       armhf        GObject introspection data for the GStreamer library
                          ii  gstreamer1.0-alsa:armhf                1.18.4-2                         armhf        GStreamer plugin for ALSA
                          ii  gstreamer1.0-gl:armhf                  1.18.4-2                         armhf        GStreamer plugins for GL
                          ii  gstreamer1.0-gtk3:armhf                1.18.4-2+deb11u1+rpt1            armhf        GStreamer plugin for GTK+3
                          ii  gstreamer1.0-libav:armhf               1.18.4-3                         armhf        ffmpeg plugin for GStreamer
                          ii  gstreamer1.0-omx                       1.0.0.1-0+rpi12+jessiepmg        armhf        GStreamer OpenMAX plugins
                          ii  gstreamer1.0-plugins-bad:armhf         1.18.4-3                         armhf        GStreamer plugins from the "bad" set
                          ii  gstreamer1.0-plugins-base:armhf        1.18.4-2                         armhf        GStreamer plugins from the "base" set
                          ii  gstreamer1.0-plugins-good:armhf        1.18.4-2                         armhf        GStreamer plugins from the "good" set
                          ii  gstreamer1.0-plugins-ugly:armhf        1.18.4-2                         armhf        GStreamer plugins from the "ugly" set
                          ii  gstreamer1.0-tools                     1.18.4-2.1                       armhf        Tools for use with GStreamer
                          ii  gstreamer1.0-x:armhf                   1.18.4-2                         armhf        GStreamer plugins for X11 and Pango
                          ii  libgstreamer-gl1.0-0:armhf             1.18.4-2                         armhf        GStreamer GL libraries
                          ii  libgstreamer-opencv1.0-0:armhf         1.18.4-3                         armhf        GStreamer OpenCV libraries
                          ii  libgstreamer-plugins-bad1.0-0:armhf    1.18.4-3                         armhf        GStreamer libraries from the "bad" set
                          ii  libgstreamer-plugins-bad1.0-dev:armhf  1.18.4-3                         armhf        GStreamer development files for libraries from the "bad" set
                          ii  libgstreamer-plugins-base1.0-0:armhf   1.18.4-2                         armhf        GStreamer libraries from the "base" set
                          ii  libgstreamer-plugins-base1.0-dev:armhf 1.18.4-2                         armhf        GStreamer development files for libraries from the "base" set
                          ii  libgstreamer1.0-0:armhf                1.18.4-2.1                       armhf        Core GStreamer libraries and elements
                          ii  libgstreamer1.0-dev:armhf              1.18.4-2.1                       armhf        GStreamer core development files
                          ii  libqt5gstreamer-1.0-0:armhf            1.2.0-5.1                        armhf        C++ bindings library for GStreamer with a Qt-style API - Qt 5 build
                          
                          pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $ apt list | grep libqt5multimedia5-plugins
                          libqt5multimedia5-plugins/stable,now 5.15.2-3 armhf [installed]
                          
                          # Compile 
                          pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $ cp subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c_backup
                          pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $ nano subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c
                          
                          #Search for method gst_v4l2_object_stop and replace it with 
                          gboolean
                          gst_v4l2_object_stop (GstV4l2Object * v4l2object)
                          {
                            GstBufferPool *pool;
                            GST_DEBUG_OBJECT (v4l2object->dbg_obj, "stopping");
                          
                            if (!GST_V4L2_IS_OPEN (v4l2object))
                              goto done;
                            if (!GST_V4L2_IS_ACTIVE (v4l2object))
                              goto done;
                          
                            pool = gst_v4l2_object_get_buffer_pool (v4l2object);
                            if (pool) {
                              if (!gst_v4l2_buffer_pool_orphan (v4l2object)) {
                                GST_DEBUG_OBJECT (v4l2object->dbg_obj, "deactivating pool");
                                gst_buffer_pool_set_active (pool, FALSE);
                          
                                {
                                  GstBufferPool *old_pool;
                                  GST_OBJECT_LOCK (v4l2object->element);
                                  old_pool = v4l2object->pool;
                                  v4l2object->pool = NULL;
                                  GST_OBJECT_UNLOCK (v4l2object->element);
                                  if (old_pool)
                                    gst_object_unref (old_pool);
                                }
                              }
                              gst_object_unref (pool);
                            }
                          
                            GST_V4L2_SET_INACTIVE (v4l2object);
                          
                          done:
                            return TRUE;
                          }
                          
                          # Add gst_v4l2_object_get_buffer_pool methdo to the end of the file
                          
                          GstBufferPool *
                          gst_v4l2_object_get_buffer_pool (GstV4l2Object * v4l2object)
                          {
                            GstBufferPool *ret = NULL;
                          
                            g_return_val_if_fail (v4l2object != NULL, NULL);
                          
                            GST_OBJECT_LOCK (v4l2object->element);
                            if (v4l2object->pool)
                              ret = gst_object_ref (v4l2object->pool);
                            GST_OBJECT_UNLOCK (v4l2object->element);
                          
                            return ret;
                          }
                          
                          # Add this line to subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.h at the end of /* probing */ block 
                          GstBufferPool * gst_v4l2_object_get_buffer_pool (GstV4l2Object * v4l2object);
                          
                          # Now compile gstreamer 1.18.6
                          ninja -C build
                          sudo ninja -C build install
                          
                          pi@raspberrypi:~/devdirs/gst-1.18.6/gst-build $  dpkg -l | grep gstream*
                          ii  gir1.2-gstreamer-1.0:armhf             1.18.4-2.1                       armhf        GObject introspection data for the GStreamer library
                          ii  gstreamer1.0-alsa:armhf                1.18.4-2                         armhf        GStreamer plugin for ALSA
                          ii  gstreamer1.0-gl:armhf                  1.18.4-2                         armhf        GStreamer plugins for GL
                          ii  gstreamer1.0-gtk3:armhf                1.18.4-2+deb11u1+rpt1            armhf        GStreamer plugin for GTK+3
                          ii  gstreamer1.0-libav:armhf               1.18.4-3                         armhf        ffmpeg plugin for GStreamer
                          ii  gstreamer1.0-omx                       1.0.0.1-0+rpi12+jessiepmg        armhf        GStreamer OpenMAX plugins
                          ii  gstreamer1.0-plugins-bad:armhf         1.18.4-3                         armhf        GStreamer plugins from the "bad" set
                          ii  gstreamer1.0-plugins-base:armhf        1.18.4-2                         armhf        GStreamer plugins from the "base" set
                          ii  gstreamer1.0-plugins-good:armhf        1.18.4-2                         armhf        GStreamer plugins from the "good" set
                          ii  gstreamer1.0-plugins-ugly:armhf        1.18.4-2                         armhf        GStreamer plugins from the "ugly" set
                          ii  gstreamer1.0-tools                     1.18.4-2.1                       armhf        Tools for use with GStreamer
                          ii  gstreamer1.0-x:armhf                   1.18.4-2                         armhf        GStreamer plugins for X11 and Pango
                          ii  libgstreamer-gl1.0-0:armhf             1.18.4-2                         armhf        GStreamer GL libraries
                          ii  libgstreamer-opencv1.0-0:armhf         1.18.4-3                         armhf        GStreamer OpenCV libraries
                          ii  libgstreamer-plugins-bad1.0-0:armhf    1.18.4-3                         armhf        GStreamer libraries from the "bad" set
                          ii  libgstreamer-plugins-bad1.0-dev:armhf  1.18.4-3                         armhf        GStreamer development files for libraries from the "bad" set
                          ii  libgstreamer-plugins-base1.0-0:armhf   1.18.4-2                         armhf        GStreamer libraries from the "base" set
                          ii  libgstreamer-plugins-base1.0-dev:armhf 1.18.4-2                         armhf        GStreamer development files for libraries from the "base" set
                          ii  libgstreamer1.0-0:armhf                1.18.4-2.1                       armhf        Core GStreamer libraries and elements
                          ii  libgstreamer1.0-dev:armhf              1.18.4-2.1                       armhf        GStreamer core development files
                          ii  libqt5gstreamer-1.0-0:armhf            1.2.0-5.1                        armhf        C++ bindings library for GStreamer with a Qt-style API - Qt 5 build
                          
                          # So the packages i compiled were not replace with packages from remote repo i installed with apt-get
                          sudo apt-get remove gstreamer1.0-plugins-good
                          
                          # Now when i do
                          pi@raspberrypi:~ $ gst-launch-1.0 --version
                          gst-launch-1.0 version 1.18.6
                          GStreamer 1.18.6
                          Unknown package origin
                          
                          # But after that removal the gst-launch-1.0 cant play back camera anymore. Maybe it was my "fix" in code that broke it. Ill roll that back and rebuild
                          # So what i did now is that i uninstalled everything related to gstreamer
                          sudo apt-get remove libgstreamer* libqt5gstreamer* gstreamer1.0*
                          
                          
                          

                          at this point i give up and work on some other stuff. maybe over time somebody will fix it for qt5 or ill try to use libcamera https://git.libcamera.org/libcamera/libcamera.git/tree/src/apps/qcam instead of QCamera or ill see if my camera works in qt6.

                          P Offline
                          P Offline
                          p1ng
                          wrote on last edited by
                          #13

                          @p1ng I gave it one more try. Compiled qt5.15.2 from source, then cross-compiled it for RPI4, 32-bit bullseye 6.1.xx

                          Compiled gstreamer 1.22.1 from source that i thought has fix for it.

                          Then ran my qt app that uses Camera, i get the same failed to allocate required memory error.

                          Running gstreamer from command line gives the same error:
                          gst-launch-1.0 -v v4l2src device=/dev/video0 ! fbdevsink

                          From this i conclude that the issue has not been fixed in gstreamer and i have to use libcamera qcam example to get qt into my raspberry qt app.

                          P 1 Reply Last reply
                          0
                          • P p1ng

                            @p1ng I gave it one more try. Compiled qt5.15.2 from source, then cross-compiled it for RPI4, 32-bit bullseye 6.1.xx

                            Compiled gstreamer 1.22.1 from source that i thought has fix for it.

                            Then ran my qt app that uses Camera, i get the same failed to allocate required memory error.

                            Running gstreamer from command line gives the same error:
                            gst-launch-1.0 -v v4l2src device=/dev/video0 ! fbdevsink

                            From this i conclude that the issue has not been fixed in gstreamer and i have to use libcamera qcam example to get qt into my raspberry qt app.

                            P Offline
                            P Offline
                            p1ng
                            wrote on last edited by
                            #14

                            @p1ng If i give gstreamer libcamerasrc though then the camera preview works
                            gst-launch-1.0 libcamerasrc ! glimagesink

                            what would i need to modify in QT source code for it to use libcamerasrc?
                            something in gstreamercamerabin?

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              p1ng
                              wrote on last edited by
                              #15

                              I managed to convert libcamera simple-cam meson example to QT project. I used chatgpt to convert meson.build to .pro file. For those in the future who are struggling integrating libcamera to qt i have uploaded the project to https://github.com/henrihallik/simple-cam-qt.
                              Also chatgpt proved vital working through various linker errors that occured. So if u need more help , just ask OpenAIs chatgpt. https://chat.openai.com/chat

                              P 1 Reply Last reply
                              0
                              • P p1ng

                                I managed to convert libcamera simple-cam meson example to QT project. I used chatgpt to convert meson.build to .pro file. For those in the future who are struggling integrating libcamera to qt i have uploaded the project to https://github.com/henrihallik/simple-cam-qt.
                                Also chatgpt proved vital working through various linker errors that occured. So if u need more help , just ask OpenAIs chatgpt. https://chat.openai.com/chat

                                P Offline
                                P Offline
                                p1ng
                                wrote on last edited by
                                #16

                                @p1ng so the simple-cam-qt was too difficult to figure out how to modify to capture an image with set resoluton. So I converted libcameras qcam project to qt project that already has image capture functionality in it.
                                U can get it here if u want to:

                                https://github.com/henrihallik/myqam

                                P 1 Reply Last reply
                                0
                                • P p1ng

                                  @p1ng so the simple-cam-qt was too difficult to figure out how to modify to capture an image with set resoluton. So I converted libcameras qcam project to qt project that already has image capture functionality in it.
                                  U can get it here if u want to:

                                  https://github.com/henrihallik/myqam

                                  P Offline
                                  P Offline
                                  p1ng
                                  wrote on last edited by
                                  #17

                                  @p1ng The qcam was still too difficult to integrate. I found edwards libcamera-cpp-demo by far the simplest example to integrate libcamera to my own code:
                                  https://github.com/edward-ardu/libcamera-cpp-demo

                                  My slightly modified version of this that specifies multiple cameras:
                                  https://github.com/edward-ardu/libcamera-cpp-demo/tree/7b3f9b97a479fb49beb01db1ddd77f5090fa52dc

                                  JoeCFDJ 1 Reply Last reply
                                  0
                                  • P p1ng has marked this topic as solved on
                                  • P p1ng

                                    @p1ng The qcam was still too difficult to integrate. I found edwards libcamera-cpp-demo by far the simplest example to integrate libcamera to my own code:
                                    https://github.com/edward-ardu/libcamera-cpp-demo

                                    My slightly modified version of this that specifies multiple cameras:
                                    https://github.com/edward-ardu/libcamera-cpp-demo/tree/7b3f9b97a479fb49beb01db1ddd77f5090fa52dc

                                    JoeCFDJ Offline
                                    JoeCFDJ Offline
                                    JoeCFD
                                    wrote on last edited by JoeCFD
                                    #18

                                    @p1ng Try 1.22.3 and it has more bug fixes.

                                    the steps(order) to install the latest gstreamer

                                    1. you may need to get the latest libva and build it.
                                    2. build gstreamer and make sure all needed plugins are built.
                                    3. build the driver of graphics card(for examples: media driver from Intel).
                                    4. build camera llib and Qt multimedia plugin
                                    5. set lib/bin path for installed gstreamer and export new driver path LIBVA_DRIVERS_PATH

                                    Since it is easy to make mistakes in gstreamer build, do not try to install it in default dirs like /usr/lib etc. Instead install all packages under /opt/gstreamer. In case anything goes wrong, you can remove the whole installation and redo it. Otherwise, you may have difficulty to use videos on your machine later on. Some installations can not be removed automatically and you have to remove them manually. Things can get very messy.

                                    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