I'm using Visual Studio 2022 with VCPKG to build a simple test program that opens a OpenCV VideoCapture object with a gstreamer pipeline to a RTSP feed.
#include <iostream>
#include <opencv2/opencv.hpp>
int main()
{
auto path = "rtspsrc location=rtsp://username:password@192.168.0.115 ! rtph264depay ! h264parse ! nvh264dec ! videoconvert ! appsink";
auto cap = new cv::VideoCapture(path, cv::CAP_GSTREAMER);
std::cout << "Hello World!\n";
}
This is my vcpkg manifest
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "opencvtest",
"version": "0.0.1",
"dependencies": [
{
"name": "opencv",
"default-features": true,
"features": [ "gstreamer" ]
},
{
"name": "gstreamer",
"default-features": true,
"features": [ "plugins-good","plugins-base","plugins-ugly","x264" ]
}
]
}
I can build the program just fine but when run, it complains about not finding the rtspsrc element.
[ WARN:0@0.014] global H:\vcpkg\buildtrees\opencv4\src\4.5.5-923325adf5.clean\modules\videoio\src\cap_gstreamer.cpp (1127) cv::GStreamerCapture::open OpenCV | GStreamer warning: Error opening bin: no element "rtspsrc"
[ WARN:0@0.014] global H:\vcpkg\buildtrees\opencv4\src\4.5.5-923325adf5.clean\modules\videoio\src\cap_gstreamer.cpp (862) cv::GStreamerCapture::isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
This seems reasonable since the build output directory doesn't seem to have all the seemingly necessary gstreamer dll's present, such as gstrtsp*.dll.
How can I get vcpkg to include all the necessary gstreamer dlls into my build output directory? What is the correct way to use OpenCV/gstreamer with vcpkg?