gstreamer 出现问题,在 Ubuntu 上使用 qt 5.10 应用程序播放视频

gstreamer 出现问题,在 Ubuntu 上使用 qt 5.10 应用程序播放视频

新笔记本电脑,安装了 Ubuntu 16.04,一切都很好。现在我正尝试使用我的 qt 应用程序播放视频。遗憾的是,我在执行此操作时收到错误 - 对于 avi 文件,我得到的是:

(myApp:2322): GStreamer-CRITICAL **: gst_caps_copy: assertion 'GST_IS_CAPS (caps)' failed

(myApp:2322): GLib-GObject-WARNING **: /build/glib2.0-7ZsPUq/glib2.0-2.48.2/./gobject/gtype.c:4273: type id '0' is invalid

(myApp:2322): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced
Segmentation fault (core dumped)

对于 mp4 文件我得到:

(myApp:2189): GStreamer-CRITICAL **: gst_caps_ref: assertion 'GST_CAPS_REFCOUNT_VALUE (caps) > 0' failed

(myApp:2189): GStreamer-CRITICAL **: gst_caps_ref: assertion 'GST_CAPS_REFCOUNT_VALUE (caps) > 0' failed

(myApp:2189): GStreamer-CRITICAL **: gst_caps_unref: assertion 'GST_CAPS_REFCOUNT_VALUE (caps) > 0' failed

(myApp:2189): GLib-GObject-WARNING **: /build/glib2.0-7ZsPUq/glib2.0-2.48.2/./gobject/gtype.c:4273: type id '0' is invalid

(myApp:2189): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced
Segmentation fault (core dumped)

我使用的是 qt 5.10、Ubuntu 16.04,尝试了多种解决此问题的建议,但都无济于事。在我的应用程序可执行文件上执行 ldd myApp | grep "gst*" 输出以下内容:

libgstreamer-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-0.10.so.0 (0x00007f41ae295000)
    libgstvideo-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstvideo-0.10.so.0 (0x00007f41adb14000)
    libgstapp-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstapp-0.10.so.0 (0x00007f41ad907000)
    libgstriff-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstriff-0.10.so.0 (0x00007f41ad6fa000)
    libgstpbutils-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstpbutils-0.10.so.0 (0x00007f41ad4d6000)
    libgstbase-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstbase-0.10.so.0 (0x00007f41a4b59000)
    libgstaudio-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstaudio-0.10.so.0 (0x00007f41a469e000)
    libgsttag-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgsttag-0.10.so.0 (0x00007f41a4466000)
    libgsm.so.1 => /usr/lib/x86_64-linux-gnu/libgsm.so.1 (0x00007f419f842000)
    libgstinterfaces-0.10.so.0 => /usr/lib/x86_64-linux-gnu/libgstinterfaces-0.10.so.0 (0x00007f419cf48000)
    libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f419c17f000)

Dpkg -l | grep "gst*" 在终端中给出

ii  gir1.2-click-0.4                            0.4.43+16.04.20170613-0ubuntu1                amd64        GIR bindings for Click package management library
ii  gir1.2-gst-plugins-bad-1.0                  1.8.3-1ubuntu0.2                              amd64        GObject introspection data for the GStreamer libraries from the "bad" set
ii  gir1.2-gst-plugins-base-1.0                 1.8.3-1ubuntu0.3                              amd64        GObject introspection data for the GStreamer Plugins Base library
ii  gir1.2-gstreamer-1.0                        1.8.3-1~ubuntu0.1                             amd64        GObject introspection data for the GStreamer library
ii  gir1.2-gtk-2.0                              2.24.30-1ubuntu1.16.04.2                      amd64        GTK+ graphical user interface library -- gir bindings
ii  gir1.2-gtk-3.0:amd64                        3.18.9-1ubuntu3.3                             amd64        GTK+ graphical user interface library -- gir bindings
ii  gir1.2-pango-1.0:amd64                      1.38.1-1                                      amd64        Layout and rendering of internationalized text - gir bindings
ii  gstreamer1.0-alsa:amd64                     1.8.3-1ubuntu0.3                              amd64        GStreamer plugin for ALSA
ii  gstreamer1.0-clutter-3.0                    3.0.18-1                                      amd64        Clutter PLugin for GStreamer 1.0
ii  gstreamer1.0-libav:amd64                    1.8.3-1ubuntu0.2                              amd64        libav plugin for GStreamer
ii  gstreamer1.0-plugins-bad:amd64              1.8.3-1ubuntu0.2                              amd64        GStreamer plugins from the "bad" set
ii  gstreamer1.0-plugins-bad-faad:amd64         1.8.3-1ubuntu0.2                              amd64        GStreamer faad plugin from the "bad" set
ii  gstreamer1.0-plugins-bad-videoparsers:amd64 1.8.3-1ubuntu0.2                              amd64        GStreamer videoparsers plugin from the "bad" set
ii  gstreamer1.0-plugins-base:amd64             1.8.3-1ubuntu0.3                              amd64        GStreamer plugins from the "base" set
ii  gstreamer1.0-plugins-base-apps              1.8.3-1ubuntu0.3                              amd64        GStreamer helper programs from the "base" set
ii  gstreamer1.0-plugins-good:amd64             1.8.3-1ubuntu0.4                              amd64        GStreamer plugins from the "good" set
ii  gstreamer1.0-plugins-ugly:amd64             1.8.3-1ubuntu0.1                              amd64        GStreamer plugins from the "ugly" set
ii  gstreamer1.0-plugins-ugly-amr:amd64         1.8.3-1ubuntu0.1                              amd64        GStreamer plugins from the "ugly" set
ii  gstreamer1.0-pulseaudio:amd64               1.8.3-1ubuntu0.4                              amd64        GStreamer plugin for PulseAudio
ii  gstreamer1.0-tools                          1.8.3-1~ubuntu0.1                             amd64        Tools for use with GStreamer
ii  gstreamer1.0-x:amd64                        1.8.3-1ubuntu0.3                              amd64        GStreamer plugins for X11 and Pango
ii  libgstreamer-plugins-bad1.0-0:amd64         1.8.3-1ubuntu0.2                              amd64        GStreamer development files for libraries from the "bad" set
ii  libgstreamer-plugins-bad1.0-dev             1.8.3-1ubuntu0.2                              amd64        GStreamer development files for libraries from the "bad" set
ii  libgstreamer-plugins-base0.10-0:amd64       0.10.36-2ubuntu0.2                            amd64        GStreamer libraries from the "base" set
ii  libgstreamer-plugins-base1.0-0:amd64        1.8.3-1ubuntu0.3                              amd64        GStreamer libraries from the "base" set
ii  libgstreamer-plugins-base1.0-dev            1.8.3-1ubuntu0.3                              amd64        GStreamer development files for libraries from the "base" set
ii  libgstreamer-plugins-good1.0-0:amd64        1.8.3-1ubuntu0.4                              amd64        GStreamer development files for libraries from the "good" set
ii  libgstreamer-plugins-good1.0-dev            1.8.3-1ubuntu0.4                              amd64        GStreamer development files for libraries from the "good" set
ii  libgstreamer0.10-0:amd64                    0.10.36-1.5ubuntu1                            amd64        Core GStreamer libraries and elements
ii  libgstreamer1.0-0:amd64                     1.8.3-1~ubuntu0.1                             amd64        Core GStreamer libraries and elements
ii  libgstreamer1.0-dev                         1.8.3-1~ubuntu0.1                             amd64        GStreamer core development files

Gst-launch-1.0 --版本输出

gst-launch-1.0 version 1.14.0
GStreamer 1.14.0
Unknown package origin

重要的一点是 - 我的应用程序在其他 ubuntu 16.04 计算机上运行没有问题。我可以使用 totem/vlc 在这台笔记本电脑上打开相同的视频,但不能使用 rhythmbox。

有什么建议么?

答案1

更新 - 经过漫长的一天,结果发现 opencv lib 链接到 gstreamer0.10,qt 链接到 1.0。这显然效果不佳。当编译 opencv 并链接到 gstreamer1.0 时,工作正常。

相关内容