GStreamer 1.0" autovideosink"不打开显示屏

时间:2015-03-03 23:10:38

标签: camera ip gstreamer rtsp

使用我的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

存在一段时间后显示屏中的捕捉停止的问题。虽然相机仍在发送rtsp数据包,直到我停止执行(ctrl + c)。

我最近安装了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的调试进行比较,因为它非常大......应该是一些&#34;打开显示&#34; gstreamer 1.0的调试输出中的行?

感谢。

1 个答案:

答案 0 :(得分:0)

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

IP camera capture

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