gst_element_factory_make() fails on MacOS for most elements
Hi, I cannot create most of elements in my C++ code on MacOS (Monterey).
However this command works fine in the terminal:
gst-launch-1.0 filesrc location="/Users/mac/Movies/myvideo.mp4" ! decodebin ! autovideosink
gst-inspect-1.0 also works fine and shows details of all those elements.
Here is my code:
gst_init(nullptr, nullptr);
GstElement* pipeline = gst_pipeline_new("pipeline");
if(pipeline) {
std::cout << "pipeline OK!\n";
} else {
std::cout << "pipeline Failed!\n";
}
GstElement* fakesrc = gst_element_factory_make("fakesrc", "fakesrc");
if(fakesrc) {
std::cout << "fakesrc OK!\n";
} else {
std::cout << "fakesrc Failed!\n";
}
GstElement* videotestsrc = gst_element_factory_make("videotestsrc", "videotestsrc");
if(videotestsrc) {
std::cout << "videotestsrc OK!\n";
} else {
std::cout << "videotestsrc Failed!\n";
}
GstElement* autovideosink = gst_element_factory_make("autovideosink", "autovideosink");
if(autovideosink) {
std::cout << "autovideosink OK!\n";
} else {
std::cout << "autovideosink Failed!\n";
}
And its output:
pipeline OK!
fakesrc OK!
videotestsrc Failed!
autovideosink Failed!
FYI, I have installed GStreamer using Brew:
brew install gstreamer
brew install gst-plugins-base
brew install gst-plugins-good
brew install gst-plugins-bad
Not sure if it's worth mentioning, but my project is created using Conan (with qt/6.3.1, gstreamer/1.19.1, gstreamer/1.19.1, etc...) and CMake.
Thanks.