通过vcpkg安装时未找到OpenCV + GStreamer udpsrc

x0fgdtte  于 2023-05-29  发布在  其他
关注(0)|答案(1)|浏览(255)

我正在使用Visual Studio 2022和VCPKG创建一个应用程序,该应用程序通过UDP和GStreamer从RaspberryPi中捕获视频。我更新了vcpkg/ports/gstreamer/portfile.cmake并添加了:vcpkg_configure_meson下的-Dgst-plugins-good:udp=enabled。之后,用gstreamer安装了opencv 4,所以vcpkh list看起来像这样:

gstreamer:x64-windows                              1.19.2#9         GStreamer open-source multimedia framework core ...
gstreamer[flac]:x64-windows                                         FLAC audio codec plugin
gstreamer[gl-graphene]:x64-windows                                  Use Graphene in OpenGL plugin
gstreamer[plugins-base]:x64-windows                                 'Base' GStreamer plugins and helper libraries
gstreamer[plugins-good]:x64-windows                                 'Good' GStreamer plugins and helper libraries
gstreamer[plugins-ugly]:x64-windows                                 'Ugly' GStreamer plugins and helper libraries
gstreamer[rawparse]:x64-windows                                     Build with libraw support
gstreamer[x264]:x64-windows                                         Colon separated list of additional x264 library ...
opencv4:x64-windows                                4.6.0#5          computer vision library
opencv4[default-features]:x64-windows                               Platform-dependent default features
opencv4[dnn]:x64-windows                                            Enable dnn module
opencv4[gstreamer]:x64-windows                                      gstreamer support for opencv
opencv4[jpeg]:x64-windows                                           JPEG support for opencv
opencv4[png]:x64-windows                                            PNG support for opencv
opencv4[quirc]:x64-windows                                          Enable QR code module
opencv4[tiff]:x64-windows                                           TIFF support for opencv
opencv4[webp]:x64-windows                                           WebP support for opencv

然而,即使gstudp.dll没有被复制到任何地方,如果我手动复制到/x64/Debug并运行我的应用程序,我得到:

[ WARN:0@0.086] global D:\C++Libs\vcpkg\buildtrees\opencv4\src\4.6.0-e24d1d7a25.clean\modules\videoio\src\cap_gstreamer.cpp (1127) cv::GStreamerCapture::open OpenCV | GStreamer warning: Error opening bin: no element "udpsrc"
[ WARN:0@0.086] global D:\C++Libs\vcpkg\buildtrees\opencv4\src\4.6.0-e24d1d7a25.clean\modules\videoio\src\cap_gstreamer.cpp (862) cv::GStreamerCapture::isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Failed to open camera.

我通过UDP和vcpkg使用OpenCV/GStreamer做错了什么?

trnvg8h3

trnvg8h31#

这是因为插件安装在gstreamer找不到的文件夹中。
要解决这个问题,可以像c:\src\vcpkg\installed\x64-windows\plugins一样指定指向它的变量GST_PLUGIN_PATH(只需更改路径以反映您的路径并给予一下)。
您还可以设置一个名为GST_DEBUG的变量,值为5,它将打印一堆信息,说明为什么找不到插件。
另外,请检查此答案GStreamer plugin search path?

相关问题