我在克隆的仓库中运行./autogen.sh
,但无法显示以下内容:
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中运行垃圾箱。得到了以下
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.
答案 0 :(得分:1)
似乎与GES内部构件有关。在内部,glib对象创建不正确,并且全部为NULL。为什么会有invalid (NULL) pointer instance
。
我能够在Mac上运行示例。软件包不匹配似乎是这里的问题。