Home:ALL Converter>OpenCV + GStreamer udpsrc not found when installed via vcpkg

OpenCV + GStreamer udpsrc not found when installed via vcpkg

Ask Time:2022-12-12T00:58:51         Author:Michael S.

Json Formatter

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:[email protected]] 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:[email protected]] 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?

Author:Michael S.,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/74762766/opencv-gstreamer-udpsrc-not-found-when-installed-via-vcpkg
yy