0

I'm using Visual Studio 2022 with VCPKG to create an application which captures video from RaspberryPi streamed via UDP with GStreamer. I updated vcpkg/ports/gstreamer/portfile.cmake and added: -Dgst-plugins-good:udp=enabled under vcpkg_configure_meson. After that, installed opencv4 with gstreamer, so vcpkh list looks like that:

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

However, even with that gstudp.dll is not copied anywhere, and if I copy it manually to /x64/Debug and run my app, I got:

[ 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.

What am I doing wrong to use OpenCV/GStreamer via UDP with vcpkg?

Michael S.
  • 155
  • 1
  • 11

1 Answers1

0

That happens because the plugins are installed in a folder that gstreamer won't find them.

To fix that, you can specify the variable GST_PLUGIN_PATH pointing to it like c:\src\vcpkg\installed\x64-windows\plugins (just change the path to reflect yours and give it a try).

You can also set a variable called GST_DEBUG with value 5, and it will print a bunch of info why it could not find the plugins.

Also, check this answer GStreamer plugin search path?.

Jayson Reis
  • 708
  • 5
  • 14