【问题标题】:Gstreamer : gst_element_factory_make() : always fail and return NULL : Qt5Gstreamer:gst_element_factory_make():总是失败并返回 NULL:Qt5
【发布时间】:2014-04-05 07:50:56
【问题描述】:

我的问题是,我无法创建 Gstreamer 元素。 我正在使用Qt 5.2.1 创建Gstreamer 项目

我在做什么:

gst_init( NULL, NULL );

GstElement *m_pipeline = gst_pipeline_new ("pipeline1");

GstElement *m_rtspSrc = gst_element_factory_make("rtspsrc", "MyRtspSrc");

但是gst_element_factory_make总是返回NULL

我已验证的内容:

  1. 检查共享对象是否在 $(libdir)/gstreamer-0.10/ 中。 (就在那里)。
  2. gst-inspect-0.10 rtspsrc。 (它提供了插件的详细信息)。
  3. gst-launch-0.10 fakesrc !我的所有插件! fakesink(它工作正常)。

我也尝试过替代方案:

GstElementFactory *factory = gst_element_factory_find ("rtspsrc"); if(factory) GstElement *m_rtspSrc = gst_element_factory_create (factory, "MyRtspSrc");

但是,gst_element_factory_find 找不到 rtspsrc

请帮我解决这个问题。

我也google了。但找不到任何解决方案。 我也参考了一些 StackOverflow 文章。

喜欢GStreamer gst_element_factory_make fails 等等,但仍有问题。

非常感谢提前。

【问题讨论】:

    标签: windows qt5 gstreamer


    【解决方案1】:

    尝试制作不同的元素,看看是否可行,例如:

    gst_element_factory_make("fakesrc", NULL);
    

    如果这也失败了,那么很可能您的环境设置不正确。您可以尝试将环境变量 GST_PLUGIN_PATH 设置为包含您的 gstreamer 插件的目录。

    【讨论】:

    • 谢谢,我只需要将GST_PLUGIN_PATH 添加到环境变量中。并且工作顺利...:)
    猜你喜欢
    • 2018-05-22
    • 2021-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-07
    • 1970-01-01
    • 2021-11-17
    • 1970-01-01
    相关资源
    最近更新 更多