什么';GStreamer管道有什么问题?

什么';GStreamer管道有什么问题?,gstreamer,pipeline,Gstreamer,Pipeline,我确信我已经在我之前设置的Ubuntu系统上使用了这个管道(格式化为可读性): 然而,当我尝试在我的程序中使用它时,我得到: Missing element: H.264 (Main Profile) decoder WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: No decoder available for type 'video/x-h264, stream-format=

我确信我已经在我之前设置的Ubuntu系统上使用了这个管道(格式化为可读性):

然而,当我尝试在我的程序中使用它时,我得到:

Missing element: H.264 (Main Profile) decoder
WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
    No decoder available for type 'video/x-h264,
    stream-format=(string)avc, alignment=(string)au,
    codec_data=(buffer)014d001fffe10017674d001f9a6602802dff35010101400000fa000030d40101000468ee3c80,
    level=(string)3.1, profile=(string)main, width=(int)1280,
    height=(int)720, framerate=(fraction)0/1, parsed=(boolean)true'.

Additional debug info:
    gsturidecodebin.c(938): unknown_type_cb ():
        /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0
现在我非常确定我已经安装了H264解码器,而且gstreamer插件
autogen.sh/configure
确实正确地识别了这一事实。安装的软件包包括
h264enc
libx264-142
libx264-dev
x264

如果我使用更“可接受的”
autovideosink
来代替
fpsdisplaysink
,或者如果我尝试使用
gst-play-1.0
播放RTSP流,则效果完全相同。但是,如果我使用测试模式source
videotestsrc
,它就可以工作


我做错了什么?

看起来gstreamer找不到合适的插件来解码H264。您没有安装H264解码器元素,或者gstreamer正在为您的元素寻找错误的路径

首先,尝试运行
gst-inspect-1.0
。这将输出gstreamer检测到的所有元素的长列表

  • 如果这不返回任何元素,您可能需要设置GST_PLUGIN_PATH环境变量以指向安装插件的目录。-这个链接应该会有所帮助
  • 如果它确实返回许多元素,请运行
    gst-inspect-1.0 avdec_h264
    以验证您是否拥有h264解码器元素

检查显示所有插件都可用,因此我不需要插件路径。我没有
avdec_h264
,但我相信
x264
会进行解码,它列在inspect output和
/usr/lib/gstreamer-1.0/libgstx264中。因此
。据我所知,没有x264解码器,只有编码器,请参阅。您需要安装/编译gst-libav以获得用于解码h264的avdec_h264元素。gst-libav确实是我所缺少的。为了在Ubuntu 16.04上安装它,我执行了:
sudo-apt-get-install-gstreamer1.0-libav
GST\u-PLUGIN\u-PATH=/usr/lib/x86\u 64-linux-gnu/gstreamer-1.0/GST-inspect-1.0-avdec\u h264,它仍然“找不到”
Missing element: H.264 (Main Profile) decoder
WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
    No decoder available for type 'video/x-h264,
    stream-format=(string)avc, alignment=(string)au,
    codec_data=(buffer)014d001fffe10017674d001f9a6602802dff35010101400000fa000030d40101000468ee3c80,
    level=(string)3.1, profile=(string)main, width=(int)1280,
    height=(int)720, framerate=(fraction)0/1, parsed=(boolean)true'.

Additional debug info:
    gsturidecodebin.c(938): unknown_type_cb ():
        /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0