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. QT 6.3: Streaming camera image

QT 6.3: Streaming camera image

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
21 Posts 5 Posters 9.8k Views 3 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.
  • K Kimosabe

    @JoeCFD @EinarJonG
    I looked now at "gst-plugins-good-1.22.1", by that I mean gst-plugins-good version 1.22.1 and there is a qt6 directory inside of it. Inside of that directory there is a "qt6_element_init (GstPlugin * plugin)" and new element called "GstGLQt6VideoItem", so I assume this is support for QT6, meaning "qml6glsink" is now available.

    I was looking gst-plugins-good source code at https://gstreamer.freedesktop.org/src/gst-plugins-good/ and it seems like qt6 support was introduced starting from 1.21.3 version. Please correct me if I am wrong.

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

    @Kimosabe good to know. Thanks. Install and try it out.
    Try to get streamer source from
    https://gitlab.freedesktop.org/gstreamer/gstreamer.git
    I remember I had some issues when I downloaded the source from the link
    https://gstreamer.freedesktop.org/src/gst-plugins-good/
    to build it.

    It can be very messy to upgrade gstreamer since you may have to rebuild Qt against the version of gstreamer you install. Also some other apps on Linux may be dependent on the specific version of gstreamer as well. You may need to rebuild all of them.

    K 1 Reply Last reply
    1
    • JoeCFDJ JoeCFD

      @Kimosabe good to know. Thanks. Install and try it out.
      Try to get streamer source from
      https://gitlab.freedesktop.org/gstreamer/gstreamer.git
      I remember I had some issues when I downloaded the source from the link
      https://gstreamer.freedesktop.org/src/gst-plugins-good/
      to build it.

      It can be very messy to upgrade gstreamer since you may have to rebuild Qt against the version of gstreamer you install. Also some other apps on Linux may be dependent on the specific version of gstreamer as well. You may need to rebuild all of them.

      K Offline
      K Offline
      Kimosabe
      wrote on last edited by
      #13

      @JoeCFD thanks for advice. Yes I am aware that updating gstreamer can break a lot of other things on Linux OS that are depending on gstreamer.
      If you manage to stream camera image via QT using new gst-plugins-good please leave a comment, so I have information if it is worth of effort to implement it on my side.

      JoeCFDJ 1 Reply Last reply
      0
      • K Kimosabe

        @JoeCFD thanks for advice. Yes I am aware that updating gstreamer can break a lot of other things on Linux OS that are depending on gstreamer.
        If you manage to stream camera image via QT using new gst-plugins-good please leave a comment, so I have information if it is worth of effort to implement it on my side.

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

        @Kimosabe I am building the latest gstreamer now because of delay and memory leak in RTSP streaming. I noticed there may be only one module QMultimediaGstTools and QMultimedia-plugins in Qt which need gstreamer. If you do not use them, simply ignore Qt rebuild. I could be wrong. But you may need to get the latest libva
        https://github.com/intel/libva.git
        to build with gstreamer. Build libva first and then gstreamer with the new streamer.

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

          Hi I'm trying to get a custom gstreamer pipeline going.
          I am building gstreamer 1.23 from source:

          git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git
          meson setup builddir
          meson compile -C builddir
          

          Once this builds, how would I then point my .pro file at this?

          For reference I am trying to build this example project.

          The current .pro file looks like this:

          TEMPLATE = app
          
          QT += qml quick widgets
          
          QT_CONFIG -= no-pkg-config
          CONFIG += link_pkgconfig debug
          PKGCONFIG = \
              gstreamer-1.0 \
              gstreamer-video-1.0
          
          DEFINES += GST_USE_UNSTABLE_API
          
          INCLUDEPATH += ../lib
          
          SOURCES += main.cpp
          
          RESOURCES += qmlsink.qrc
          
          # Additional import path used to resolve QML modules in Qt Creator's code model
          QML_IMPORT_PATH =
          

          How would I modify this .pro file to point to my gstreamer build?

          Currently the line

          #include <gst/gst.h>
          

          in main.cpp references my system's gstreamer at /usr/include/gstreamer-1.0/gst/gst.h.

          The line

          import org.freedesktop.gstreamer.Qt6GLVideoItem 1.0
          
          

          in main.qml throws an error.

          JoeCFDJ 1 Reply Last reply
          0
          • P prettyQt

            Hi I'm trying to get a custom gstreamer pipeline going.
            I am building gstreamer 1.23 from source:

            git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git
            meson setup builddir
            meson compile -C builddir
            

            Once this builds, how would I then point my .pro file at this?

            For reference I am trying to build this example project.

            The current .pro file looks like this:

            TEMPLATE = app
            
            QT += qml quick widgets
            
            QT_CONFIG -= no-pkg-config
            CONFIG += link_pkgconfig debug
            PKGCONFIG = \
                gstreamer-1.0 \
                gstreamer-video-1.0
            
            DEFINES += GST_USE_UNSTABLE_API
            
            INCLUDEPATH += ../lib
            
            SOURCES += main.cpp
            
            RESOURCES += qmlsink.qrc
            
            # Additional import path used to resolve QML modules in Qt Creator's code model
            QML_IMPORT_PATH =
            

            How would I modify this .pro file to point to my gstreamer build?

            Currently the line

            #include <gst/gst.h>
            

            in main.cpp references my system's gstreamer at /usr/include/gstreamer-1.0/gst/gst.h.

            The line

            import org.freedesktop.gstreamer.Qt6GLVideoItem 1.0
            
            

            in main.qml throws an error.

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

            @prettyQt
            do not install it now. Otherwise, you will mess it up with the installed gstreamer version.
            rm -rf builddir
            meson setup -prefix=/opt/gstreamer builddir /* install it to a place which does not affect the installed one */
            ninja -C builddir
            sudo ninja install -C builddir

            P 2 Replies Last reply
            1
            • JoeCFDJ JoeCFD

              @prettyQt
              do not install it now. Otherwise, you will mess it up with the installed gstreamer version.
              rm -rf builddir
              meson setup -prefix=/opt/gstreamer builddir /* install it to a place which does not affect the installed one */
              ninja -C builddir
              sudo ninja install -C builddir

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

              @JoeCFD thanks that makes sense. Once this is done, how would I then utilize this build in the Qt project?

              JoeCFDJ 1 Reply Last reply
              0
              • P prettyQt

                @JoeCFD thanks that makes sense. Once this is done, how would I then utilize this build in the Qt project?

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

                @prettyQt
                set the right path for compiling with the built gstreamer

                export PKG_CONFIG_PATH=/opt/gstreamer/lib/pkgconfig/:/opt/gstreamer/share/pkgconfig:$PKG_CONFIG_PATH
                

                to test and run, the following is also needed

                export PATH=/opt/gstreamer/bin:$PATH
                export LD_LIBRARY_PATH=/opt/gstreamer/lib:$LD_LIBRARY_PATH
                which gst-inspect-1.0 /* to check the right bin path */
                ldd /opt/gstreamer/bin/gst-inspect-1.0 /* to check the right lib path */ 
                

                Not sure if you need to rebuild qmultimedia module with the new gstreamer version. Also the video driver may need to be rebuilt as well.

                1 Reply Last reply
                1
                • JoeCFDJ JoeCFD

                  @prettyQt
                  do not install it now. Otherwise, you will mess it up with the installed gstreamer version.
                  rm -rf builddir
                  meson setup -prefix=/opt/gstreamer builddir /* install it to a place which does not affect the installed one */
                  ninja -C builddir
                  sudo ninja install -C builddir

                  P Offline
                  P Offline
                  prettyQt
                  wrote on last edited by
                  #19

                  @JoeCFD I got an error when running

                  sudo ninja install -C builddir/
                  
                  ninja: Entering directory `builddir/'
                  [1/2] Installing files.
                  Traceback (most recent call last):
                    File "/home/robby/.local/bin/meson", line 5, in <module>
                      from mesonbuild.mesonmain import main
                  ModuleNotFoundError: No module named 'mesonbuild'
                  FAILED: meson-internal__install 
                  /home/robby/.local/bin/meson install --no-rebuild
                  ninja: build stopped: subcommand failed.
                  
                  

                  Any ideas?

                  P 1 Reply Last reply
                  0
                  • P prettyQt

                    @JoeCFD I got an error when running

                    sudo ninja install -C builddir/
                    
                    ninja: Entering directory `builddir/'
                    [1/2] Installing files.
                    Traceback (most recent call last):
                      File "/home/robby/.local/bin/meson", line 5, in <module>
                        from mesonbuild.mesonmain import main
                    ModuleNotFoundError: No module named 'mesonbuild'
                    FAILED: meson-internal__install 
                    /home/robby/.local/bin/meson install --no-rebuild
                    ninja: build stopped: subcommand failed.
                    
                    

                    Any ideas?

                    P Offline
                    P Offline
                    prettyQt
                    wrote on last edited by
                    #20

                    It looks like the version of meson sudo was using was wrong. It worked after I ran

                    sudo python3 -m pip install meson
                    

                    This post talks about it.

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      prettyQt
                      wrote on last edited by
                      #21

                      When running the example code, I get this error:

                      0:00:00.205244082 71309 0x556ff36ea0d0 ERROR            qtglutility gstqt6glutility.cc:242:gst_qml6_get_gl_wrapcontext: cannot wrap qt OpenGL context
                      

                      Has anyone seen or solved this?

                      1 Reply Last reply
                      0
                      • JoeCFDJ JoeCFD referenced this topic on

                      • Login

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