Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. GStreamer with QT6
QtWS25 Last Chance

GStreamer with QT6

Scheduled Pinned Locked Moved Unsolved General and Desktop
gstreamergstreamer1.0gst
24 Posts 4 Posters 3.4k 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 12 Jul 2024, 19:16 last edited by
    #3

    Hi,

    Beside the platform as requested by @JoeCFD, do you mean you want to use the QtMultimedia backend or use GStreamer explicitly in your code ?

    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
    • J JoeCFD
      12 Jul 2024, 16:03

      Linux or Windows?

      J Offline
      J Offline
      Joe von Habsburg
      wrote on 15 Jul 2024, 20:33 last edited by
      #4

      @JoeCFD said in GStreamer with QT6:

      Linux or Windows?

      for windows.

      @SGaist said in GStreamer with QT6:

      QtMultimedia backend or use GStreamer explicitly in your code ?

      when I use QtMultimedia rtsp stream is lagging or freezing. but If I use gstream there is a no problem. How can I implement my code or how can I watch stream like gstream quality ?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JoeCFD
        wrote on 16 Jul 2024, 10:57 last edited by JoeCFD
        #5

        I think pkg can be applied in Windows as well. Try the following example

        find_package( PkgConfig REQUIRED )
        pkg_search_module( GSTREAMER REQUIRED IMPORTED_TARGET gstreamer-1.0 >= 1.22 )
        pkg_search_module( GSTREAMER-VIDEO REQUIRED IMPORTED_TARGET gstreamer-video-1.0 >= 1.22 )
        target_link_libraries( ${PROJECT_NAME} PkgConfig::GSTREAMER
        PkgConfig::GSTREAMER-VIDEO )

        The path in the pkg files of gstreamer might not be right. However, it can be changed in all pkg files. I guess relative path is good enough and works for me on Linux. You need to figure out how to set pkg path on Windows.

        J 1 Reply Last reply 17 Jul 2024, 06:34
        0
        • J JoeCFD
          16 Jul 2024, 10:57

          I think pkg can be applied in Windows as well. Try the following example

          find_package( PkgConfig REQUIRED )
          pkg_search_module( GSTREAMER REQUIRED IMPORTED_TARGET gstreamer-1.0 >= 1.22 )
          pkg_search_module( GSTREAMER-VIDEO REQUIRED IMPORTED_TARGET gstreamer-video-1.0 >= 1.22 )
          target_link_libraries( ${PROJECT_NAME} PkgConfig::GSTREAMER
          PkgConfig::GSTREAMER-VIDEO )

          The path in the pkg files of gstreamer might not be right. However, it can be changed in all pkg files. I guess relative path is good enough and works for me on Linux. You need to figure out how to set pkg path on Windows.

          J Offline
          J Offline
          Joe von Habsburg
          wrote on 17 Jul 2024, 06:34 last edited by Joe von Habsburg
          #6

          @JoeCFD said in GStreamer with QT6:

          pkg_search_module(

          C:\Users\X\Desktop\XX\XXX\CMakeLists.txt:13: error: A required package was not found

          Call stack:
          C:\Users\X\Desktop\XX\XXX\CMakeLists.txt:13 (pkg_check_modules)
          C:/Qt/Tools/CMake_64/share/cmake-3.27/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)
          C:/Qt/Tools/CMake_64/share/cmake-3.27/Modules/FindPkgConfig.cmake:607 (message)

          2b49ad4e-ac71-40f5-b1be-35fa9d3b91a1-image.png

          7a38fc86-8c58-4454-bd92-f6e2fa88e774-image.png

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Joe von Habsburg
            wrote on 17 Jul 2024, 07:49 last edited by
            #7

            Call stack:
            C:\Users\X\Desktop\XX\XXX\CMakeLists.txt:13: error: None of the required 'gstreamer-1.0' found

            C:\Users\X\Desktop\XX\XXX\CMakeLists.txt:14: error: None of the required 'gstreamer-video-1.0' found

            J 1 Reply Last reply 17 Jul 2024, 11:20
            0
            • J Joe von Habsburg
              17 Jul 2024, 07:49

              Call stack:
              C:\Users\X\Desktop\XX\XXX\CMakeLists.txt:13: error: None of the required 'gstreamer-1.0' found

              C:\Users\X\Desktop\XX\XXX\CMakeLists.txt:14: error: None of the required 'gstreamer-video-1.0' found

              J Offline
              J Offline
              JoeCFD
              wrote on 17 Jul 2024, 11:20 last edited by JoeCFD
              #8

              @Joe-von-Habsburg I edited my post. You need to figure out how to set pkg path on Windows.

              On linux:
              export PKG_CONFIG_PATH=/opt/thirdParties/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH

              it is easier to use pkg config to add packages into a project because all dependencies are taken care of. But you can add all libs manually as well.

              J 2 Replies Last reply 17 Jul 2024, 12:43
              0
              • J JoeCFD
                17 Jul 2024, 11:20

                @Joe-von-Habsburg I edited my post. You need to figure out how to set pkg path on Windows.

                On linux:
                export PKG_CONFIG_PATH=/opt/thirdParties/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH

                it is easier to use pkg config to add packages into a project because all dependencies are taken care of. But you can add all libs manually as well.

                J Offline
                J Offline
                Joe von Habsburg
                wrote on 17 Jul 2024, 12:43 last edited by
                #9

                @JoeCFD said in GStreamer with QT6:

                I edited my post.

                2ea2964c-f599-4cd6-ba4e-632e5eab64dc-image.png

                316c8b1b-abc1-453b-b453-0a006b4c86bc-image.png

                8514d4bc-e555-48a2-9888-53078ce4ff62-image.png

                J 1 Reply Last reply 17 Jul 2024, 13:12
                0
                • J Joe von Habsburg
                  17 Jul 2024, 12:43

                  @JoeCFD said in GStreamer with QT6:

                  I edited my post.

                  2ea2964c-f599-4cd6-ba4e-632e5eab64dc-image.png

                  316c8b1b-abc1-453b-b453-0a006b4c86bc-image.png

                  8514d4bc-e555-48a2-9888-53078ce4ff62-image.png

                  J Offline
                  J Offline
                  JoeCFD
                  wrote on 17 Jul 2024, 13:12 last edited by
                  #10

                  @Joe-von-Habsburg I think you did not set pkg configure path. If you do not know how to set it, find the pkg files in gstreamer installation and add all the libs inside to your project.

                  J 1 Reply Last reply 17 Jul 2024, 13:18
                  0
                  • J JoeCFD
                    17 Jul 2024, 13:12

                    @Joe-von-Habsburg I think you did not set pkg configure path. If you do not know how to set it, find the pkg files in gstreamer installation and add all the libs inside to your project.

                    J Offline
                    J Offline
                    Joe von Habsburg
                    wrote on 17 Jul 2024, 13:18 last edited by
                    #11

                    @JoeCFD said in GStreamer with QT6:

                    I think you did not set pkg configure path. If you do not know how to set it, find the pkg files in gstreamer installation and add all the libs inside to your project.

                    PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/bin/pkgconfig:$PKG_CONFIG_PATH

                    aa513e32-c20d-4c29-852b-5f524bb2f231-image.png

                    J 1 Reply Last reply 17 Jul 2024, 13:55
                    0
                    • J Joe von Habsburg
                      17 Jul 2024, 13:18

                      @JoeCFD said in GStreamer with QT6:

                      I think you did not set pkg configure path. If you do not know how to set it, find the pkg files in gstreamer installation and add all the libs inside to your project.

                      PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/bin/pkgconfig:$PKG_CONFIG_PATH

                      aa513e32-c20d-4c29-852b-5f524bb2f231-image.png

                      J Offline
                      J Offline
                      JoeCFD
                      wrote on 17 Jul 2024, 13:55 last edited by JoeCFD
                      #12

                      @Joe-von-Habsburg pkg config path is under gstreamer lib dir.
                      For example in Linux
                      /opt/thirdParties/gstreamer/lib/pkgconfig
                      Maybe it is different in Windows
                      and pkg-config.exe has to be in system path of Windows.

                      J 1 Reply Last reply 17 Jul 2024, 13:57
                      0
                      • J JoeCFD
                        17 Jul 2024, 13:55

                        @Joe-von-Habsburg pkg config path is under gstreamer lib dir.
                        For example in Linux
                        /opt/thirdParties/gstreamer/lib/pkgconfig
                        Maybe it is different in Windows
                        and pkg-config.exe has to be in system path of Windows.

                        J Offline
                        J Offline
                        Joe von Habsburg
                        wrote on 17 Jul 2024, 13:57 last edited by
                        #13

                        @JoeCFD said in GStreamer with QT6:

                        @Joe-von-Habsburg pkg config path is under gstreamer lib dir.
                        For example in Linux
                        /opt/thirdParties/gstreamer/lib/pkgconfig
                        Maybe it is different in Windows

                        There is only C:/gstreamer/1.0/msvc_x86_64/bin/pkg-config.exe

                        f54da375-fd5f-45e0-9293-b867c00310aa-image.png

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          JoeCFD
                          wrote on 17 Jul 2024, 14:01 last edited by JoeCFD
                          #14

                          add C:/gstreamer/1.0/msvc_x86_64/bin to PATH on Windows. This enables you to run pkg-config.exe and use pkg-config. Nice that gstreamer includes it for you.
                          go to C:/gstreamer/1.0/msvc_x86_64/lib to find dir pkgconfig. Add C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig to PKG_CONFIG_PATH

                          Do not forget to add gstreamer plugin path as well in your env. Otherwise, you can not run your gstreamer app.

                          J 1 Reply Last reply 17 Jul 2024, 14:09
                          0
                          • J JoeCFD
                            17 Jul 2024, 14:01

                            add C:/gstreamer/1.0/msvc_x86_64/bin to PATH on Windows. This enables you to run pkg-config.exe and use pkg-config. Nice that gstreamer includes it for you.
                            go to C:/gstreamer/1.0/msvc_x86_64/lib to find dir pkgconfig. Add C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig to PKG_CONFIG_PATH

                            Do not forget to add gstreamer plugin path as well in your env. Otherwise, you can not run your gstreamer app.

                            J Offline
                            J Offline
                            Joe von Habsburg
                            wrote on 17 Jul 2024, 14:09 last edited by
                            #15

                            @JoeCFD said in GStreamer with QT6:

                            C:/gstreamer/1.0/msvc_x86_64/bin to PATH on Window

                            it already exists

                            d4060ddb-aee4-4ad8-befe-b0a0b3335a59-image.png

                            @JoeCFD said in GStreamer with QT6:

                            C:/gstreamer/1.0/msvc_x86_64/lib to find dir pkgconfig

                            there is no pkg lib

                            a99c75f6-6b8e-4674-aebb-25deac87ad1f-image.png

                            6ee8b5b1-7fe4-4a6d-8b25-ca79eb592edf-image.png

                            83ef1969-2dc6-46e9-9ce2-35e4c3e96535-image.png

                            2b124ea5-9f96-4f71-8218-4342a5cfa93f-image.png

                            @JoeCFD said in GStreamer with QT6:

                            C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig

                            its not here.

                            I have only pkg-config exe in C:/gstreamer/1.0/msvc_x86_64/bin/pkg-config.exe

                            1 Reply Last reply
                            0
                            • J Offline
                              J Offline
                              JoeCFD
                              wrote on 17 Jul 2024, 15:54 last edited by
                              #16

                              If it does not exist, you are unable to use it. I can check it out later for you in my home Windows.

                              J 1 Reply Last reply 17 Jul 2024, 15:55
                              0
                              • J JoeCFD
                                17 Jul 2024, 15:54

                                If it does not exist, you are unable to use it. I can check it out later for you in my home Windows.

                                J Offline
                                J Offline
                                Joe von Habsburg
                                wrote on 17 Jul 2024, 15:55 last edited by
                                #17

                                @JoeCFD thank you so much, I will wait and research new solutions

                                J 1 Reply Last reply 17 Jul 2024, 15:56
                                0
                                • J Joe von Habsburg
                                  17 Jul 2024, 15:55

                                  @JoeCFD thank you so much, I will wait and research new solutions

                                  J Offline
                                  J Offline
                                  JoeCFD
                                  wrote on 17 Jul 2024, 15:56 last edited by JoeCFD
                                  #18

                                  @Joe-von-Habsburg
                                  https://stackoverflow.com/questions/63026758/cannot-compile-gstreamer-on-windows-because-it-is-missing-glib-2-0

                                  it can be there. Try to reinstall it in different ways.

                                  1 Reply Last reply
                                  0
                                  • J JoeCFD
                                    17 Jul 2024, 11:20

                                    @Joe-von-Habsburg I edited my post. You need to figure out how to set pkg path on Windows.

                                    On linux:
                                    export PKG_CONFIG_PATH=/opt/thirdParties/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH

                                    it is easier to use pkg config to add packages into a project because all dependencies are taken care of. But you can add all libs manually as well.

                                    J Offline
                                    J Offline
                                    Joe von Habsburg
                                    wrote on 18 Jul 2024, 06:25 last edited by Joe von Habsburg
                                    #19

                                    I download files with msys :

                                    pacman -S mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \
                                          mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \
                                          mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav \
                                          mingw-w64-x86_64-gst-rtsp-server
                                    

                                    and I copy the pkgconfig to lib like that

                                    image.png

                                    and gsreamer-1.0.pc and gsteamer-video-1.0.pc exist

                                    image.png

                                    cmake like that :

                                    PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig:$PKG_CONFIG_PATH
                                    find_package( PkgConfig REQUIRED )
                                    pkg_search_module( GSTREAMER REQUIRED IMPORTED_TARGET gstreamer-1.0)
                                    pkg_search_module( GSTREAMER-VIDEO REQUIRED IMPORTED_TARGET gstreamer-video-1.0)
                                    

                                    but its not work

                                    aee5e95a-84a0-49ce-9c13-fc96965b9d94-image.png

                                    J 1 Reply Last reply 18 Jul 2024, 10:46
                                    0
                                    • J Joe von Habsburg
                                      18 Jul 2024, 06:25

                                      I download files with msys :

                                      pacman -S mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \
                                            mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \
                                            mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav \
                                            mingw-w64-x86_64-gst-rtsp-server
                                      

                                      and I copy the pkgconfig to lib like that

                                      image.png

                                      and gsreamer-1.0.pc and gsteamer-video-1.0.pc exist

                                      image.png

                                      cmake like that :

                                      PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig:$PKG_CONFIG_PATH
                                      find_package( PkgConfig REQUIRED )
                                      pkg_search_module( GSTREAMER REQUIRED IMPORTED_TARGET gstreamer-1.0)
                                      pkg_search_module( GSTREAMER-VIDEO REQUIRED IMPORTED_TARGET gstreamer-video-1.0)
                                      

                                      but its not work

                                      aee5e95a-84a0-49ce-9c13-fc96965b9d94-image.png

                                      J Offline
                                      J Offline
                                      JoeCFD
                                      wrote on 18 Jul 2024, 10:46 last edited by JoeCFD
                                      #20

                                      @Joe-von-Habsburg said in GStreamer with QT6:

                                      PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig:$PKG_CONFIG_PATH

                                      ":" is missing in the picture.
                                      PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig:$PKG_CONFIG_PATH

                                      J 1 Reply Last reply 22 Jul 2024, 06:07
                                      0
                                      • J JoeCFD
                                        18 Jul 2024, 10:46

                                        @Joe-von-Habsburg said in GStreamer with QT6:

                                        PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig:$PKG_CONFIG_PATH

                                        ":" is missing in the picture.
                                        PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig:$PKG_CONFIG_PATH

                                        J Offline
                                        J Offline
                                        Joe von Habsburg
                                        wrote on 22 Jul 2024, 06:07 last edited by
                                        #21

                                        @JoeCFD said in GStreamer with QT6:

                                        ":" is missing in the picture.

                                        I forgot about it and added it. the code shows it as added. but nothing happened. i keep getting the error. i'm sure the solution is very simple in linux. i wish it could be the same in windows.

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          anonymus982493
                                          wrote on 22 Jul 2024, 08:28 last edited by
                                          #22

                                          hey, the problem is that you need to write it like this:
                                          set(PKG_CONFIG_PATH=C:/gstreamer/1.0/msvc_x86_64/lib/pkgconfig:$PKG_CONFIG_PATH)
                                          this way it should work, I had the same problem last week

                                          J 1 Reply Last reply 22 Jul 2024, 12:33
                                          0

                                          12/24

                                          17 Jul 2024, 13:55

                                          • Login

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