gstreamer - 构建 Gstreamer 编辑服务失败

标签 gstreamer

我跑 ./autogen.sh在克隆的 repo 中,它没有说以下内容:

configure: No package 'gstreamer-plugins-base-1.0' found
configure: error: no gstreamer-plugins-base-1.0 >= 1.14.1 (GStreamer Base Plugins) found
  configure failed

我的 Ubuntu 上安装了 gstreamer(基本的、好的、坏的和丑陋的)。构建脚本寻找的包名是 gstreamer-plugins-base-1.0其中系统包的名称是 gstreamer1.0-plugins-base .

深入研究 autoconf 设置,我发现以下内容:
if test -z $GSTPB_PLUGINS_DIR; then
  GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-[$1]`
  if test -z $GSTPB_PLUGINS_DIR; then
    AC_MSG_ERROR(
      [no pluginsdir set in GStreamer Base Plugins pkg-config file])
  fi
fi

不应该是gstreamer[$1]-plugins-base ?我在这里错过了什么吗?

更新:

通过安装 libgstreamer1.0-dev 修复了上述问题和 libgstreamer-plugins-base1.0-dev开发包
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

如果默认情况下未安装 GIntrospection,请运行以下命令
sudo apt-get build-dep gstreamer1.0
./autogen.sh将完成和 make && sudo make install也会运行良好。

当前状态:示例未构建稳定的二进制文件。运行 c 示例 segfault 和 python 示例,simple.py , 投诉失踪 GES在命名空间中。
Traceback (most recent call last):
  File "simple.py", line 26, in <module>
    gi.require_version('GES', '1.0')
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 130, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GES not available

仅供引用:Simple.py 看起来像这样
import gi

gi.require_version('Gst', '1.0')
gi.require_version('GES', '1.0')

from gi.repository import Gst, GES, GLib  # noqa


class Simple:
    def __init__(self, uri):
        timeline = GES.Timeline.new_audio_video()
        self.project = timeline.get_asset()

        self.project.connect("asset-added", self._asset_added_cb)
        self.project.connect("error-loading-asset", self._error_loading_asset_cb)
        self.project.create_asset(uri, GES.UriClip)
        self.layer = timeline.append_layer()
        self._create_pipeline(timeline)
        self.loop = GLib.MainLoop()

    def _create_pipeline(self, timeline):
        self.pipeline = GES.Pipeline()
        self.pipeline.set_timeline(timeline)
        bus = self.pipeline.get_bus()
        bus.add_signal_watch()
        bus.connect("message", self.bus_message_cb)

    def bus_message_cb(self, unused_bus, message):
        if message.type == Gst.MessageType.EOS:
            print("eos")
            self.loop.quit()
        elif message.type == Gst.MessageType.ERROR:
            error = message.parse_error()
            print("error %s" % error[1])
            self.loop.quit()

    def start(self):
        self.loop.run()

    def _asset_added_cb(self, project, asset):
        self.layer.add_asset(asset, 0, 0, Gst.SECOND * 5, GES.TrackType.UNKNOWN)
        self.pipeline.set_state(Gst.State.PLAYING)

    def _error_loading_asset_cb(self, project, error, asset_id, type):
        print("Could not load asset %s: %s" % (asset_id, error))
        self.loop.quit()

if __name__ == "__main__":
    if len(os.sys.argv) != 2:
        print("You must specify a file URI")
        exit(-1)

    Gst.init(None)
    GES.init()
    simple = Simple(os.sys.argv[1])
    simple.start()

运行 C 示例 simple1.c 失败并显示以下内容:
(simple1:15606): GLib-GObject-WARNING **: 12:42:28.910: invalid (NULL) pointer instance

(simple1:15606): GLib-GObject-CRITICAL **: 12:42:28.910: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(simple1:15606): GLib-GObject-WARNING **: 12:42:28.910: invalid (NULL) pointer instance

(simple1:15606): GLib-GObject-CRITICAL **: 12:42:28.910: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(simple1:15606): GLib-GObject-CRITICAL **: 12:42:28.910: g_object_set: assertion 'G_IS_OBJECT (object)' failed
[1]    15606 segmentation fault (core dumped)  ./simple1 ~/Downloads/out.mp4

运行 gdb,
gst-editing-services/examples/c/simple1": not in executable format: File format not recognized

更新

使用 Meson 构建系统重新构建示例。这使得在 gdb 中运行 bins 成为可能。得到以下
Program received signal SIGSEGV, Segmentation fault.
ges_track_constructed (object=<optimized out>) at ../ges/ges-track.c:506
506         componame =

表明它在 ges-track.c 失败。相关代码如下:
  if (self->type == GES_TRACK_TYPE_VIDEO) {
    componame =
        g_strdup_printf ("video_%s", GST_OBJECT_NAME (self->priv->composition));
  } else if (self->type == GES_TRACK_TYPE_AUDIO) {
    componame = // This is where it errirs
        g_strdup_printf ("audio_%s", GST_OBJECT_NAME (self->priv->composition));
  }

一行一行地走进去。揭露了以下内容。
0x00007ffff701c2cd in __GI__dl_catch_exception (exception=exception@entry=0x7fffffffc980,
    operate=0x7ffff54530d0 <dlsym_doit>, args=0x7fffffffc9f0) at dl-error-skeleton.c:194
    194     dl-error-skeleton.c: No such file or directory.

最佳答案

看起来它与 GES 内部结构有关。在内部,glib 对象没有正确创建并且都是 NULL。为什么是您拥有 invalid (NULL) pointer instance 的原因.

我能够在我的 mac 上运行这些示例。包不匹配似乎是这里的问题。

关于gstreamer - 构建 Gstreamer 编辑服务失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51645861/

相关文章:

Gstreamer:如何使音频和视频以相同的速率播放

udp - 如何使用 udp gstreamer 流式传输 h264

c - Gstreamer 管道中的时间戳

c++ - 是否有链接到 GStreamer 1.0 的 OpenCV 版本?

opencv - linux上的无损avi编码

ios - 仅带有 GStreamer iOS 框架的 27MB IPA...我如何才能变得更小?

camera - Gstreamer ffdec_h264 缺失

audio - 无法让 JACK 音频/网络插孔通过 LAN 工作

gstreamer - 将 4 个音频 channel 交错到 gstreamer 中的 vorbisenc 或 opusenc 中

c - GstBuffer 像素类型(确定 BPP)