Gstreamer : gst_element_factory_make() : always fail and return NULL : Qt5

感情迁移 提交于 2019-12-02 04:03:26

问题


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 :

  1. Checked if shared object is in $(libdir)/gstreamer-0.10/. (It is there).
  2. gst-inspect-0.10 rtspsrc. (Its gives details of the plugin).
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!