【问题标题】:Rtsp h264 missing pluginrtsp h264 缺少插件
【发布时间】:2016-09-07 15:46:20
【问题描述】:

我正在尝试使用 RTSP 从无线摄像机接收实时 H264 流。摄像头IP为192.168.150.1,无需认证。

由于我是在windows下开发的,所以我安装了Gstreamer 1.0 - 1.8.3,一个完整的安装,在安装过程中选择了所有的插件和所有东西。

当我尝试管道时

gst-launch-1.0 rtspsrc location="rtsp://192.168.150.1" latency=100 ! rtph264depay ! avdec_h264 ! autovideosink

我收到这个输出:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.150.1
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: No supported stream was found. You might need to allow more transport protocols or may otherwise be missing the right GStreamer RTSP extension plugin.
Additional debug info:
gstrtspsrc.c(6421): gst_rtspsrc_setup_streams (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

我还尝试了以下命令:

gst-play-1.0 rtsp://192.168.150.1

得到这个输出:

Interactive keyboard handling in terminal not available.
Now playing rtsp://192.168.150.1
Pipeline is live.
ERROR Your GStreamer installation is missing a plug-in. for rtsp://192.168.150.1
ERROR debug information: gsturidecodebin.c(1006): no_more_pads_full (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstrtspsrc.c(6421): gst_rtspsrc_setup_streams (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source
Reached end of play list.

当我在 VLC 中尝试相同的 URL (rtsp://192.168.150.1) 时,我可以看到流。所以我的猜测是我缺少“正确的 GStreamer RTSP 扩展插件”

inspect-1.0 | grep 264 的输出为:

File STDIN:
x264:  x264enc: x264enc
videoparsersbad:  h264parse: H.264 parser
typefindfunctions: video/x-h264: h264, x264, 264
rtp:  rtph264depay: RTP H264 depayloader
rtp:  rtph264pay: RTP H264 payloader
openh264:  openh264dec: OpenH264 video decoder
openh264:  openh264enc: OpenH264 video encoder
libav:  avdec_h264: libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 decoder
libav:  avmux_ipod: libav iPod H.264 MP4 (MPEG-4 Part 14) muxer

我也尝试使用 FFmpeg,我可以看到视频,但我更喜欢使用 Gstreamer,因为我将在 Android 设备上使用相同的配置(相机、管道、gstreamer 库...),我认为Gstreamer 似乎是最佳选择。

从 FFmpeg 我得到了有关流的信息

Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 640x352, 29.92 tbr, 90k tbn, 180k tbc

有没有人有一些建议来解决这个问题? 我错过了哪个插件?以及如何添加我的安装?

编辑: gst-launch-1.0.exe -v playbin uri=rtsp://192.168.150.1的输出

Setting pipeline to PAUSED ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = rtsp://192.168.150.1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstRTSPSrc\)\ source"
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.150.1
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
gsturidecodebin.c(1006): no_more_pads_full (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstrtspsrc.c(6421): gst_rtspsrc_setup_streams (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

【问题讨论】:

  • 你可以试试 gst-inspect-1.0 rtspsrc - 那是什么意思?
  • @SamerTufail 它为 rtspsrc 打印整个“文档”
  • 这意味着您有所需的 rtspsrc 插件,您可以尝试 gst-launch-1.0 -v playbin2 uri=rtsp://192.168.150.1 - 如果这不播放由生成的消息是什么冗长的
  • @SamerTufail 已编辑问题(我认为 playbin2 在 Gstreamer 的 0.1 版本中)
  • 真的,playbin 应该没问题。您可以尝试通过 gst-launch-1.0 -v rtspsrc location="rtsp://192.168.150.1" latency=100 破坏您的管道来根除丢失的插件! fakesink 如果这在您的控制台上显示传入的数据包,请添加更多插件 b.w 您的 rtspsrc 和 fakesink like - rtspsrc! rtph264depay! fakesink - 不要忘记 gst-launch-1.0 上的 -v

标签: windows video-streaming gstreamer rtsp


【解决方案1】:

我在使用 GStreamer/1.8.3 时遇到了完全相同的问题。

原因是我的相机没有在其会话描述中提供"Control URL" 属性,而在这种情况下,GStreamer 不够聪明,无法回退到基本 URL(就像其他播放器一样)。

所以,我运行以下命令从 GStreamer 获取详细日志:

gst-play-1.0 rtsp://camera_ip:port/ --gst-debug-level=9 --gst-debug-no-color &> GSTREAMER_LOGS.txt

在日志中我发现了这一行:

DEBUG  rtspsrc gstrtspsrc.c:6109:gst_rtspsrc_setup_streams:<source> skipping stream 0x7f01b402c140, no setup

然后查看 Kurento 的 gst-plugins-good 包中的当前 gstrtspsrc.c 代码,我发现“跳过流...,没有设置”错误仅在 stream-&gt;conninfo.location == NULL 时发生。正如我所说,发生这种情况是因为我的相机没有在 SDP 中提供“控制 URL”属性。将以下行添加到我的相机 SDP 会话描述中解决了我的问题:

a=control:*

但是,一般来说,这可能需要在 GStreamer 代码中修复。

【讨论】:

    【解决方案2】:

    我相信这是 VLC 和 ffmpeg 不共享的 GStreamer 的限制。我在这里也有类似的情况,我有三个不同的 RTSP 摄像机,两个可以在 GStreamer 上正常工作,一个不能。这三个都适用于 VLC 和 ffmpeg。

    我使用 Wireshark 查看了原始 RTSP 协议,发现与 GStreamer 一起工作的两台相机包含一个 sprop-parameter-sets 参数字段,而不工作的相机则没有此字段。

    在 sprop-parameter-sets 中编码的信息(SPS 和 PPS 数据)通常存在于来自相机的 RTP 流中。显然 VLC 和 ffmpeg 足够聪明,可以接受这个,但 GStreamer 不是。

    我尝试使用 caps 命令行参数手动插入 sprop-parameter-sets 数据,但不成功。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-24
      • 2015-10-30
      • 2021-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多