这个 GStreamer 管道有什么问题?

What's wrong with this GStreamer pipeline?

我确定我已经在我设置的早期 Ubuntu 系统上运行了这个管道(为了便于阅读而格式化):

playbin
    uri=rtspt://user:pswd@192.168.xxx.yyy/ch1/main
    video-sink='videoconvert
                ! videoflip method=counterclockwise
                ! fpsdisplaysink'

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

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 确实正确地识别了这个事实。安装的软件包是 h264enclibx264-142libx264-devx264

如果我使用 more "acceptable" autovideosink 代替 fpsdisplaysink,或者如果我尝试使用 gst-play-1.0 播放 RTSP 流,它会做同样的事情.但是,如果我使用测试模式源 videotestsrc.

我做错了什么?

gstreamer 似乎找不到合适的解码 H264 的插件。要么您没有安装 H264 解码器元素,要么 gstreamer 正在寻找您的元素的错误路径。

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

  • 如果这没有 return 任何元素,您可能需要设置 GST_PLUGIN_PATH 环境变量以指向安装插件的目录。 Running Gstreamer - 这个 link 应该有帮助。
  • 如果它有 return 个元素,运行 gst-inspect-1.0 avdec_h264 以验证您是否拥有 H264 解码器元素。