I'm trying to load a gstreamer plugin using boost::process to call gst-launch
.
When I load the plugin via the command line everything works well:
gst-launch-1.0 videotestsrc ! privacyprotector ! fakesink
If I use the full path to the executable, it also works well:
bp::child c("/opt/intel/openvino/data_processing/gstreamer/bin/gst-launch-1.0 videotestsrc ! privacyprotector ! fakesink", ec);
But if I try to find the executable in the path and send the parameters as a separate parameter to bp::child
, then gstreamer is unable to find the plugin:
bp::child c(bp::search_path("gst-launch-1.0"), bp::args("videotestsrc ! privacyprotector ! fakesink"), ec);
Is there anything specific to parameter handling I'm missing?
I think the arguments need to be a vector:
So, try
#include <boost/process.hpp>
#include <iostream>
namespace bp = boost::process;
int main() {
std::error_code ec;
bp::child c(
bp::search_path("gst-launch-1.0"),
bp::args = {"videotestsrc", "!", "privacyprotector", "!", "fakesink"},
ec);
c.wait();
std::cout << ec.message() << ": " << c.exit_code();
}
Which, on my system prints:
WARNING: erroneous pipeline: no element "privacyprotector"
Success: 1