问题
My problem is, I cannot create Gstreamer element.
I am creating Gstreamer project using Qt 5.2.1
What I am doing :
gst_init( NULL, NULL );
GstElement *m_pipeline = gst_pipeline_new ("pipeline1");
GstElement *m_rtspSrc = gst_element_factory_make("rtspsrc", "MyRtspSrc");
But gst_element_factory_make always return NULL.
What I have verified :
- Checked if shared object is in $(libdir)/gstreamer-0.10/. (It is there).
gst-inspect-0.10 rtspsrc. (Its gives details of the plugin).- gst-launch-0.10 fakesrc ! my_all_plugin ! fakesink (Its works fine).
I have also tried alternative option :
GstElementFactory *factory = gst_element_factory_find ("rtspsrc");
if(factory)
GstElement *m_rtspSrc = gst_element_factory_create (factory, "MyRtspSrc");
But, gst_element_factory_find can not find rtspsrc.
Please help me out from this problem.
I have also google it. But can not find any solution. I have refer few StackOverflow articles too.
Like GStreamer gst_element_factory_make fails and many more, but still have the issue.
Many many thanks in Advance.
回答1:
Try to make a different element and see if that works, e.g.:
gst_element_factory_make("fakesrc", NULL);
If that also fails then it is likely your environment is not set up correctly. You can try setting the environment variable GST_PLUGIN_PATH to the directory containing your gstreamer plugins.
来源:https://stackoverflow.com/questions/22878125/gstreamer-gst-element-factory-make-always-fail-and-return-null-qt5