GStreamer with QT6
-
@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 ?
-
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.
-
@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) -
Call stack:
C:\Users\X\Desktop\XX\XXX\CMakeLists.txt:13: error: None of the required 'gstreamer-1.0' foundC:\Users\X\Desktop\XX\XXX\CMakeLists.txt:14: error: None of the required 'gstreamer-video-1.0' found
-
@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_PATHit 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.
-
-
@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.
-
@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
-
@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. -
@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 WindowsThere is only C:/gstreamer/1.0/msvc_x86_64/bin/pkg-config.exe
-
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_PATHDo not forget to add gstreamer plugin path as well in your env. Otherwise, you can not run your gstreamer app.
-
@JoeCFD said in GStreamer with QT6:
C:/gstreamer/1.0/msvc_x86_64/bin to PATH on Window
it already exists
@JoeCFD said in GStreamer with QT6:
C:/gstreamer/1.0/msvc_x86_64/lib to find dir pkgconfig
there is no pkg lib
@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
-
@Joe-von-Habsburg
https://stackoverflow.com/questions/63026758/cannot-compile-gstreamer-on-windows-because-it-is-missing-glib-2-0it can be there. Try to reinstall it in different ways.
-
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
and gsreamer-1.0.pc and gsteamer-video-1.0.pc exist
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
-
@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 -
@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.
-
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 -
Could not work on me :/
Where do you install gstreamer and where do you install pkgconfig folder in lib ?