【问题标题】:GStreamer 1.0 "autovideosink" does not open the displayGStreamer 1.0“autovideosink”不打开显示
【发布时间】:2015-03-20 21:31:10
【问题描述】:

使用安装在我的 ubuntu 14.04 中的默认 GStreamer 0.10,我可以捕获我的 IP 摄像头:

gst-launch-0.10 rtspsrc location=rtsp://admin:123456@192.168.2.254:554/mpeg4cif latency=0 ! decodebin ! ffmpegcolorspace ! autovideosink

有一段时间后显示中的捕获停止的问题。尽管在我停止执行(ctrl+c)之前,相机仍在发送 rtsp 数据包。

我最近安装了最新版本的 gstreamer:

sudo add-apt-repository ppa:gstreamer-developers/ppa
sudo apt-get update
sudo apt-get install gstreamer1.0*

检查这个新版本是否可以解决这个问题,我可以持续可视化我的 IP 摄像头的流,以便以后使用 openCV 进行处理。

我已尝试执行下一个管道:

gst-launch-1.0 rtspsrc location=rtsp://admin:123456@192.168.0.123:554/mpeg4cif ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! autovideosink sync=false

gst-launch-1.0 rtspsrc location=rtsp://admin:123456@192.168.0.123:554/mpeg4cif ! rtph264depay ! h264parse ! decodebin ! videoconvert ! autovideosink sync=false

gst-launch-1.0 rtspsrc location=rtsp://admin:123456@192.168.0.123:554/mpeg4cif ! rtph264depay ! avdec_h264 ! decodebin ! videoconvert ! autovideosink sync=false

没有人有执行问题,但没有人打开显示。使用wireshark,我可以看到相机发送的数据包与使用gstreamer-0.10时相同。如果我解决了显示问题,我可以检查这个新版本是否能够连续显示流,或者它会在一段时间后停止,就像使用 gst-0.10 时一样。

有什么建议可以试试吗?也许一些不同的管道?

提前致谢。

编辑: 我使用 GST_DEBUG=4 启动命令,最后几行如下所示:

0:00:02.464441942  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<pipeline0> child 'decodebin0' changed state to 4(PLAYING) successfully
0:00:02.464531274  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2227:gst_bin_element_set_state:<h264parse0> current PLAYING pending VOID_PENDING, desired next PLAYING
0:00:02.465086353  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2344:gst_bin_element_set_state:<h264parse0> skipping transition from PLAYING to  PLAYING
0:00:02.465157352  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<pipeline0> child 'h264parse0' changed state to 4(PLAYING) successfully
0:00:02.465725181  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2227:gst_bin_element_set_state:<rtph264depay0> current PLAYING pending VOID_PENDING, desired next PLAYING
0:00:02.465791014  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2344:gst_bin_element_set_state:<rtph264depay0> skipping transition from PLAYING to  PLAYING
0:00:02.465838513  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<pipeline0> child 'rtph264depay0' changed state to 4(PLAYING) successfully
0:00:02.466158677  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2227:gst_bin_element_set_state:<rtspsrc0> current PLAYING pending VOID_PENDING, desired next PLAYING
0:00:02.466264010  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<rtspsrc0> child 'udpsink1' changed state to 4(PLAYING) successfully
0:00:02.466379426  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<rtspsrc0> child 'manager' changed state to 4(PLAYING) successfully
0:00:02.466448925  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<rtspsrc0> child 'udpsrc0' changed state to 4(PLAYING) successfully
0:00:02.467028587  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<rtspsrc0> child 'udpsrc1' changed state to 4(PLAYING) successfully
0:00:02.467105419  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<rtspsrc0> child 'udpsink0' changed state to 4(PLAYING) successfully
0:00:02.467439333  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<rtspsrc0> child 'fakesrc0' changed state to 4(PLAYING) successfully
0:00:02.467504750  2517 0xb4e364f0 INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<rtspsrc0> completed state change to PLAYING
0:00:02.467558749  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<pipeline0> child 'rtspsrc0' changed state to 4(PLAYING) successfully
0:00:02.467620332  2517 0xb4e364f0 INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<pipeline0> completed state change to PLAYING
0:00:02.467672581  2517 0xb4e364f0 INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:02.585214105  2517 0xb4e12c60 INFO               GST_EVENT gstevent.c:628:gst_event_new_caps: creating caps event application/x-rtcp
0:00:02.585415937  2517 0xb4e12c60 INFO               GST_EVENT gstevent.c:709:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:03.340291666  2517 0xb4e12af0 INFO               GST_EVENT gstevent.c:709:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:03.345178707  2517 0xb4e12af0 INFO                 basesrc gstbasesrc.c:2772:gst_base_src_loop:<udpsrc1> marking pending DISCONT
0:00:03.349542005  2517 0xb4e12af0 INFO               GST_EVENT gstevent.c:628:gst_event_new_caps: creating caps event application/x-rtcp, ssrc=(uint)246759908
0:00:03.352920727  2517 0xb4e12af0 INFO               GST_EVENT gstevent.c:628:gst_event_new_caps: creating caps event application/x-rtcp
0:00:03.358691179  2517 0xb4e12af0 INFO               GST_EVENT gstevent.c:628:gst_event_new_caps: creating caps event application/x-rtcp, ssrc=(uint)246759908

我不太了解 gstreamer 内部是如何工作的,但一切似乎都是正确的。

调试输出中与 autovideosink 相关的最后几行是:

0:00:02.458109994  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2227:gst_bin_element_set_state:<autovideosink0> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:02.458178994  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2227:gst_bin_element_set_state:<autovideosink0-actual-sink-nvoverlay> current PAUSED pending VOID_PENDING, desired next PLAYING
0:00:02.460078228  2517 0xb4e364f0 INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<autovideosink0-actual-sink-nvoverlay> completed state change to PLAYING
0:00:02.460137644  2517 0xb4e364f0 INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<autovideosink0-actual-sink-nvoverlay> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:02.460328226  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<autovideosink0> child 'autovideosink0-actual-sink-nvoverlay' changed state to 4(PLAYING) successfully
0:00:02.460389892  2517 0xb4e364f0 INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<autovideosink0> completed state change to PLAYING
0:00:02.460436142  2517 0xb4e364f0 INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<autovideosink0> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:02.460566224  2517 0xb4e364f0 INFO              GST_STATES gstbin.c:2656:gst_bin_change_state_func:<pipeline0> child 'autovideosink0' changed state to 4(PLAYING) successfully

我无法将调试与 0.10 的调试进行比较,因为它非常大...应该在 gstreamer 1.0 的调试输出中出现一些“打开的显示”行吗?

谢谢。

【问题讨论】:

  • 执行“export GST_DEBUG=4”查看日志
  • 谢谢你的提示,我不知道。无论如何,我无法弄清楚错误在哪里。我用一些调试输出编辑了帖子。
  • 它可以与 playbin 一起使用吗?
  • playbin 与 gst-launch-1.0 相机开始仅发送 UDP 数据包并且不显示显示,但使用 gst-launch-0.10,RTP 数据包由相机发送并打开显示,但有 3 秒的延迟,一段时间后显示不再刷新,与我之前描述的情况相同。

标签: camera ip gstreamer rtsp


【解决方案1】:

由于我的目标是捕获视频以使用 OpenCV 处理帧,因此我将解决方案更改为使用 gstreamer-0.10 C API。我在这里打开的另一篇文章中解释了解决方案:

IP camera capture

使用 C API,我在捕获、处理和可视化方面没有任何问题。 :)

【讨论】:

    猜你喜欢
    • 2012-08-02
    • 1970-01-01
    • 1970-01-01
    • 2014-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多