【发布时间】: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