gstreamer pipeline rtspsrc reconnect
I'm attempting to add some functionality to reconnect my rtspsrc to an IP camera. Everything works fine when the application is launched. Then I power cycle the IP Camera to simulate a connection issue. When an error is received on the message bus for the rtsp connection, the rtspsrc moves through these states: pause->null->ready->playing. I also find that I need to relink the rtspsrc src pad to the next element's sink pad after restarting (rtph264depay). I only link the src pad with the video caps (this is how the pipeline launches initially, when working).
This is where things get fuzzy for me. The video output connected to autovideosink (name=autovideosinkHome below) remains frozen. To see where the data is stopping I add a blocking probe to each pad in the pipeline chain one by one, dropping all of the buffers and see if data is reaching each pad. In my first pipeline below, without a queue in front of autovideosink, data reaches all the way to the autovideosink's sink pad fine. Once I remove the blocking probe, however, in front of the autovideosink I end up with the following error:
gstbasesrc.c(2950): void gst_base_src_loop(GstPad *) (): /GstPipeline:pipeline0/GstRTSPSrc:rtsp_Home/GstUDPSrc:udpsrc6: streaming stopped, reason error (-5)
It looks like -5 equates to a DATA_FLOW_ERROR. If I add a queue2 element in front of the autovideosink, data flow quickly comes to a halt (but no error)
here is the pipeline without the queue:
rtspsrc debug=true retry=200 timeout=0 latency=1000 ntp-sync=false drop-on-latency=false max-size-buffers=2000 max-size-bytes=6144000 max-size-time=1000000000 probation=200 do-retransmission=true max-rtcp-rtp-time-diff=-1 name=rtsp_Home udp-buffer-size=6144000 location=rtsp://192.168.1.15:554/h264Preview_01_main ! rtph264depay name=branch_rtsp_Home ! h264parse ! decodebin ! videoconvert ! autovideosink name=autovideosinkHome async=false
With Queue (same as above until end of pipeline):
....! queue2 ! autovideosink name=autovideosinkHome async=false
Is there anything i need to do to prepare the pipeline, or the sinks when I restart a source?
链接地址: http://www.djcxy.com/p/43990.html