Rtsp stream, pipeline restart doesn't work. Could rtspsrc be the issue?

Hi.

I have pipeline like:

rtspsrc ! rtph264depay ! h264parse ...

Code for pipeline restaring:

                    RtspPipeline.SetState(State.Null);
                    RtspPipeline.SetState(State.Ready);
                    RtspPipeline.SetState(State.Playing);

I’m modeling disconnecting via vpn connect/disconnect. Initially everything works, connected, then I disconnect vpn. wait few retry and delay itrations and connect again. Connection is restored because I got sdp message but eventyally I get

basesrc gstbasesrc.c:3132:gst_base_src_loop:<udpsrc6> error: streaming stopped, reason not-linked (-1)

I have no clue why it is happening… I saw somewhere on internet people in this case simply create new rtspsrc element and link it into pipeline, instead of old element Should I do the same? Any idea how to properly restard current pipeline without recreating it from scratch?
Here is debug log for udpsrc and rtspsrc, after event parse SDP (hence connection is acutally established, SDP received but somehow error happens).
Also note, I see some strange error in the end
<rtspsrc0> combined flows: not-linked

0:01:36.800572000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:8317:gst_rtspsrc_retrieve_sdp:<rtspsrc0> parse SDP...
0:01:36.804028400 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7926:gst_rtspsrc_parse_range:<rtspsrc0> parsed range npt=now-
0:01:36.806426900 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7939:gst_rtspsrc_parse_range:<rtspsrc0> range: type 1, min 0.000000 - type 2,  max 0.000000
0:01:36.808420800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7949:gst_rtspsrc_parse_range:<rtspsrc0> range: min 0:00:00.000000000
0:01:36.812020500 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7968:gst_rtspsrc_parse_range:<rtspsrc0> range: max 99:99:99.999999999
0:01:36.818927800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7993:gst_rtspsrc_parse_range:<rtspsrc0> not updating existing duration 99:99:99.999999999 from range 99:99:99.999999999
0:01:36.821294100 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2262:gst_rtspsrc_collect_payloads: mapping sdp session level attributes to caps
0:01:36.824574600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2264:gst_rtspsrc_collect_payloads: mapping sdp media level attributes to caps
0:01:36.827483600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2282:gst_rtspsrc_collect_payloads:<rtspsrc0>  looking at 0 pt: 96
0:01:36.835510700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2428:gst_rtspsrc_create_stream:<rtspsrc0> stream 0, (000002CAAAE67ED0)
0:01:36.838224400 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2429:gst_rtspsrc_create_stream:<rtspsrc0>  port: 0
0:01:36.842714700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2430:gst_rtspsrc_create_stream:<rtspsrc0>  container: 0
0:01:36.850732100 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2431:gst_rtspsrc_create_stream:<rtspsrc0>  control: rtsp://some_url
0:01:36.852381300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2458:gst_rtspsrc_create_stream:<rtspsrc0>  setup: rtsp://some_url
0:01:36.855423800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:543:default_select_stream:<rtspsrc0> default handler
0:01:36.863416800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:554:select_stream_accum: accum 1
0:01:36.865565000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7603:gst_rtspsrc_setup_streams_start:<rtspsrc0> doing setup of stream 000002CAAAE67ED0 with  rtsp://some_url
0:01:36.867292200 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7618:gst_rtspsrc_setup_streams_start:<rtspsrc0> protocols = 0x7, protocol mask = 0x1
0:01:36.871547100 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7081:gst_rtspsrc_create_transports_string:<rtspsrc0> got transports (NULL)
0:01:36.873489000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7111:gst_rtspsrc_create_transports_string:<rtspsrc0> adding UDP unicast
0:01:36.875334400 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7138:gst_rtspsrc_create_transports_string:<rtspsrc0> prepared transports RTP/AVP;unicast;client_port=%%u1-%%u2
0:01:36.877222700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7633:gst_rtspsrc_setup_streams_start:<rtspsrc0> replace ports in RTP/AVP;unicast;client_port=%%u1-%%u2
0:01:36.879005200 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1527:gst_udpsrc_open:<udpsrc5> allocating socket for 0.0.0.0:0
0:01:36.881340800 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1476:gst_udpsrc_resolve:<udpsrc5> IP address for host 0.0.0.0 is 0.0.0.0
0:01:36.883074300 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1540:gst_udpsrc_open:<udpsrc5> got socket 000002CAACCE8620
0:01:36.888700000 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1547:gst_udpsrc_open:<udpsrc5> binding on port 0
21:08:09.591 [37840:9 ] [INF] [myapp] Gst.DebugMessage
0:01:36.894668100 37840 000002CAACCEB340 INFO                  udpsrc gstudpsrc.c:1613:gst_udpsrc_open:<udpsrc5> setting udp buffer of 524288 bytes
21:08:09.592 [37840:9 ] [INF] [myapp] Gst.DebugMessage
0:01:36.896489500 37840 000002CAACCEB340 INFO                  udpsrc gstudpsrc.c:1652:gst_udpsrc_open:<udpsrc5> have udp buffer of 524288 bytes
0:01:36.899101500 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1770:gst_udpsrc_open:<udpsrc5> bound, on port 51845
0:01:36.902994500 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1773:gst_udpsrc_open:<udpsrc5> notifying port 51845
0:01:36.911020300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2657:gst_rtspsrc_alloc_udp_ports:<rtspsrc0> got RTP port 51845
0:01:36.913290000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2665:gst_rtspsrc_alloc_udp_ports:<rtspsrc0> RTP port not even
0:01:36.915873200 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2667:gst_rtspsrc_alloc_udp_ports:<rtspsrc0> free RTP udpsrc
0:01:36.919386600 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1852:gst_udpsrc_close: closing sockets
0:01:36.927341900 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2672:gst_rtspsrc_alloc_udp_ports:<rtspsrc0> retry 1
0:01:36.932000400 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1527:gst_udpsrc_open:<udpsrc6> allocating socket for 0.0.0.0:51846
0:01:36.935443000 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1476:gst_udpsrc_resolve:<udpsrc6> IP address for host 0.0.0.0 is 0.0.0.0
0:01:36.943759600 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1540:gst_udpsrc_open:<udpsrc6> got socket 000002CAA8FFC180
0:01:36.945752500 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1547:gst_udpsrc_open:<udpsrc6> binding on port 51846
21:08:09.647 [37840:9 ] [INF] [myapp] Gst.DebugMessage
0:01:36.957743400 37840 000002CAACCEB340 INFO                  udpsrc gstudpsrc.c:1613:gst_udpsrc_open:<udpsrc6> setting udp buffer of 524288 bytes
21:08:09.655 [37840:9 ] [INF] [myapp] Gst.DebugMessage
0:01:36.959336000 37840 000002CAACCEB340 INFO                  udpsrc gstudpsrc.c:1652:gst_udpsrc_open:<udpsrc6> have udp buffer of 524288 bytes
0:01:36.961258000 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1770:gst_udpsrc_open:<udpsrc6> bound, on port 51846
0:01:36.963524300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2657:gst_rtspsrc_alloc_udp_ports:<rtspsrc0> got RTP port 51846
0:01:36.971496300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:2689:gst_rtspsrc_alloc_udp_ports:<rtspsrc0> starting RTCP on port 51847
0:01:36.974167900 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1527:gst_udpsrc_open:<udpsrc7> allocating socket for 0.0.0.0:51847
0:01:36.975786000 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1476:gst_udpsrc_resolve:<udpsrc7> IP address for host 0.0.0.0 is 0.0.0.0
0:01:36.977446700 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1540:gst_udpsrc_open:<udpsrc7> got socket 000002CAA8FFC310
0:01:36.987452600 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1547:gst_udpsrc_open:<udpsrc7> binding on port 51847
21:08:09.685 [37840:9 ] [INF] [myapp] Gst.DebugMessage
0:01:36.989133600 37840 000002CAACCEB340 INFO                  udpsrc gstudpsrc.c:1652:gst_udpsrc_open:<udpsrc7> have udp buffer of 65536 bytes
0:01:36.991594900 37840 000002CAACCEB340 DEBUG                 udpsrc gstudpsrc.c:1770:gst_udpsrc_open:<udpsrc7> bound, on port 51847
0:01:36.993389400 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7644:gst_rtspsrc_setup_streams_start:<rtspsrc0> transport is now RTP/AVP;unicast;client_port=51846-51847
0:01:37.004032100 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:564:default_before_send:<rtspsrc0> default handler
0:01:37.006485000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:6736:gst_rtspsrc_try_send:<rtspsrc0> sending message
0:01:37.369224700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:6638:gst_rtsp_src_receive_response:<rtspsrc0> received response message
0:01:37.372063300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:6657:gst_rtsp_src_receive_response:<rtspsrc0> got response message 200
0:01:37.373827500 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7355:gst_rtsp_src_setup_stream_from_response:<rtspsrc0> stream 000002CAAAE67ED0 as UDP unicast
0:01:37.375943000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4888:gst_rtspsrc_stream_configure_transport:<rtspsrc0> configuring transport for stream 000002CAAAE67ED0
0:01:37.377933700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4897:gst_rtspsrc_stream_configure_transport:<rtspsrc0> setting media type to application/x-rtp
0:01:37.380007600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4092:gst_rtspsrc_stream_configure_manager:<rtspsrc0> using manager rtpbin
0:01:37.382106700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4196:gst_rtspsrc_stream_configure_manager:<rtspsrc0> connect to signals on session manager, stream 000002CAAAE67ED0
0:01:37.386799600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3859:request_rtp_decoder: decoder session 0, stream 000002CAAAE67ED0, 0
0:01:37.392258900 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3543:new_manager_pad:<rtspsrc0> got new manager pad <manager:recv_rtp_sink_0>
0:01:37.394685600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3621:new_manager_pad:<rtspsrc0> ignoring unknown stream
0:01:37.397826300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3859:request_rtp_decoder: decoder session 0, stream 000002CAAAE67ED0, 0
0:01:37.403672700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3543:new_manager_pad:<rtspsrc0> got new manager pad <manager:recv_rtcp_sink_0>
0:01:37.406100600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3621:new_manager_pad:<rtspsrc0> ignoring unknown stream
21:08:10.104 [37840:9 ] [INF] [myapp] Gst.DebugMessage
0:01:37.407652300 37840 000002CAACCEB340 INFO                 rtspsrc gstrtspsrc.c:4239:gst_rtspsrc_stream_configure_manager:<rtspsrc0> configure bandwidth in session 000002CAAAE42F80
21:08:10.105 [37840:9 ] [INF] [myapp] Gst.DebugMessage
0:01:37.409235300 37840 000002CAACCEB340 INFO                 rtspsrc gstrtspsrc.c:4245:gst_rtspsrc_stream_configure_manager:<rtspsrc0> setting AS: 50000000.000000
0:01:37.411714600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4618:gst_rtspsrc_stream_configure_udp:<rtspsrc0> setting up UDP source
0:01:37.414202800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4648:gst_rtspsrc_stream_configure_udp:<rtspsrc0> connecting UDP source 0 to manager
0:01:37.420564300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4679:gst_rtspsrc_stream_configure_udp:<rtspsrc0> connecting UDP source 1 to manager
0:01:37.423817500 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4726:gst_rtspsrc_stream_configure_udp_sinks:<rtspsrc0> configure RTP UDP sink for 192.168.5.56:50000
0:01:37.426270900 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4747:gst_rtspsrc_stream_configure_udp_sinks:<rtspsrc0> RTP UDP src has sock 000002CAA8FFC180
0:01:37.428360600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4789:gst_rtspsrc_stream_configure_udp_sinks:<rtspsrc0> configure RTCP UDP sink for 192.168.5.56:50001
0:01:37.431079000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:4811:gst_rtspsrc_stream_configure_udp_sinks:<rtspsrc0> RTCP UDP src has sock 000002CAA8FFC310
0:01:37.435217700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3892:request_rtcp_encoder: decoder session 0, stream 000002CAAAE67ED0, 0
0:01:37.437614400 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3543:new_manager_pad:<rtspsrc0> got new manager pad <manager:send_rtcp_src_0>
0:01:37.440251000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:3621:new_manager_pad:<rtspsrc0> ignoring unknown stream
0:01:37.442007000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:9370:gst_rtspsrc_thread:<rtspsrc0> got command PLAY
0:01:37.443676800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:5441:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
0:01:37.451131300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:8830:gst_rtspsrc_play:<rtspsrc0> PLAY...
0:01:37.453174300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:5017:gst_rtspsrc_send_dummy_packets:<rtspsrc0> sending dummy packet to stream 000002CAAAE67ED0
0:01:37.456264300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:564:default_before_send:<rtspsrc0> default handler
0:01:37.458164000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:6736:gst_rtspsrc_try_send:<rtspsrc0> sending message
0:01:37.632386100 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:6638:gst_rtsp_src_receive_response:<rtspsrc0> received response message
0:01:37.637965800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:6657:gst_rtsp_src_receive_response:<rtspsrc0> got response message 200
0:01:37.640495200 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7926:gst_rtspsrc_parse_range:<rtspsrc0> parsed range npt=now-
0:01:37.642493600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7939:gst_rtspsrc_parse_range:<rtspsrc0> range: type 1, min 0.000000 - type 2,  max 0.000000
0:01:37.644351300 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7949:gst_rtspsrc_parse_range:<rtspsrc0> range: min 0:00:00.000000000
0:01:37.646635200 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7968:gst_rtspsrc_parse_range:<rtspsrc0> range: max 99:99:99.999999999
0:01:37.651343700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:7993:gst_rtspsrc_parse_range:<rtspsrc0> not updating existing duration 99:99:99.999999999 from range 99:99:99.999999999
0:01:37.653491500 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:8586:gst_rtspsrc_parse_rtpinfo:<rtspsrc0> parsing RTP-Info url=rtsp://some_url/stream=0?videocodec=h264;seq=25682;rtptime=2820874980
0:01:37.656152700 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:8595:gst_rtspsrc_parse_rtpinfo:<rtspsrc0> parsing info url=rtsp://some_url/stream=0?videocodec=h264;seq=25682;rtptime=2820874980
0:01:37.658358600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:8609:gst_rtspsrc_parse_rtpinfo:<rtspsrc0> parsing field url=rtsp://some_url/stream=0?videocodec=h264
0:01:37.660373900 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:8609:gst_rtspsrc_parse_rtpinfo:<rtspsrc0> parsing field seq=25682
0:01:37.662618800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:8609:gst_rtspsrc_parse_rtpinfo:<rtspsrc0> parsing field rtptime=2820874980
0:01:37.669019500 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:8627:gst_rtspsrc_parse_rtpinfo:<rtspsrc0> found stream 000002CAAAE67ED0, setting: seqbase 25682, timebase 2820874980
0:01:37.671653600 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:5095:gst_rtspsrc_configure_caps:<rtspsrc0> configuring stream caps
0:01:37.674678100 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:5135:gst_rtspsrc_configure_caps:<rtspsrc0> stream 000002CAAAE67ED0, pt 96, caps application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264, packetization-mode=(string)1, profile-level-id=(string)4d0029, sprop-parameter-sets=(string)"Z00AKeKQDwBE/LgLcBAQGkHiRFQ\=\,aO48gA\=\=", a-tool=(string)GStreamer, a-type=(string)broadcast, a-framerate=(string)25.000000, a-transform=(string)"1.000000\,0.000000\,0.000000\;0.000000\,1.000000\,0.000000\;0.000000\,0.000000\,1.000000", ssrc=(uint)2024998096, clock-base=(uint)2820874980, seqnum-base=(uint)25682, npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1, onvif-mode=(boolean)false
0:01:37.676958100 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:5145:gst_rtspsrc_configure_caps:<rtspsrc0> clear session
0:01:37.685399000 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:9071:gst_rtspsrc_play:<rtspsrc0> mark DISCONT, we did a seek to another position
0:01:37.690982900 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:9370:gst_rtspsrc_thread:<rtspsrc0> got command LOOP
0:01:37.692579200 37840 000002CAACEFB400 DEBUG                rtspsrc gstrtspsrc.c:3440:pad_blocked:<rtspsrc0> pad udpsrc6:src blocked, activating streams
0:01:37.697110800 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:5441:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
0:01:37.701582000 37840 000002CAACEFB400 DEBUG                rtspsrc gstrtspsrc.c:5038:gst_rtspsrc_activate_streams:<rtspsrc0> activating streams
0:01:37.703031500 37840 000002CAACCEB340 DEBUG                rtspsrc gstrtspsrc.c:5945:gst_rtspsrc_loop_udp:<rtspsrc0> doing receive with timeout 54 seconds
0:01:37.704782600 37840 000002CAACEFB400 DEBUG                rtspsrc gstrtspsrc.c:5078:gst_rtspsrc_activate_streams:<rtspsrc0> unblocking stream pad 000002CAAAE67ED0
0:01:37.713118700 37840 000002CAAD0C6180 DEBUG                rtspsrc gstrtspsrc.c:3543:new_manager_pad:<rtspsrc0> got new manager pad <manager:recv_rtp_src_0_2024998096_96>
0:01:37.716073300 37840 000002CAAD0C6180 DEBUG                rtspsrc gstrtspsrc.c:3551:new_manager_pad:<rtspsrc0> stream: 0, SSRC 78b304d0, PT 96
0:01:37.718104000 37840 000002CAAD0C6180 DEBUG                rtspsrc gstrtspsrc.c:3569:new_manager_pad:<rtspsrc0> stream 000002CAAAE67ED0, container 0, added 1, setup 1
0:01:37.720110900 37840 000002CAAD0C6180 DEBUG                rtspsrc gstrtspsrc.c:3490:copy_sticky_events:<'':recv_rtp_src_0_2024998096_96> send sticky event stream-start event: 000002CAACF189A0, time 99:99:99.999999999, seq-num 1526, GstEventStreamStart, stream-id=(string)b63652b6363c525d94c0313b601382d66c7e8aaea0ae6a19b03f32ac8e883392/2024998096/96, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)10;
0:01:37.722965800 37840 000002CAAD0C6180 DEBUG                rtspsrc gstrtspsrc.c:3490:copy_sticky_events:<'':recv_rtp_src_0_2024998096_96> send sticky event caps event: 000002CAACF18A80, time 99:99:99.999999999, seq-num 1527, GstEventCaps, caps=(GstCaps)"application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ profile-level-id\=\(string\)4d0029\,\ sprop-parameter-sets\=\(string\)\"Z00AKeKQDwBE/LgLcBAQGkHiRFQ\\\=\\\,aO48gA\\\=\\\=\"\,\ a-tool\=\(string\)GStreamer\,\ a-type\=\(string\)broadcast\,\ a-framerate\=\(string\)25.000000\,\ a-transform\=\(string\)\"1.000000\\\,0.000000\\\,0.000000\\\;0.000000\\\,1.000000\\\,0.000000\\\;0.000000\\\,0.000000\\\,1.000000\"\,\ ssrc\=\(uint\)2024998096\,\ clock-base\=\(uint\)2820874980\,\ seqnum-base\=\(uint\)25682\,\ npt-start\=\(guint64\)0\,\ play-speed\=\(double\)1\,\ play-scale\=\(double\)1\,\ onvif-mode\=\(boolean\)false";
0:01:37.728869600 37840 000002CAAD0C6180 DEBUG                rtspsrc gstrtspsrc.c:3490:copy_sticky_events:<'':recv_rtp_src_0_2024998096_96> send sticky event segment event: 000002CAACEF5AF0, time 99:99:99.999999999, seq-num 1487, GstEventSegment, segment=(GstSegment)"segment, flags=(GstSegmentFlags)GST_SEGMENT_FLAG_NONE, rate=(double)1, applied-rate=(double)1, format=(GstFormat)time, base=(guint64)0, offset=(guint64)0, start=(guint64)0, stop=(guint64)18446744073709551615, time=(guint64)0, position=(guint64)0, duration=(guint64)18446744073709551615;";
0:01:37.732017900 37840 000002CAAD0C6180 DEBUG                rtspsrc gstrtspsrc.c:3610:new_manager_pad:<rtspsrc0> We added all streams
21:08:10.433 [37840:33] [WRN] [myapp] Gst.DebugMessage
0:01:37.736923200 37840 000002CAACEFB400 WARN                 basesrc gstbasesrc.c:3132:gst_base_src_loop:<udpsrc6> error: Internal data stream error.
21:08:10.435 [37840:33] [WRN] [myapp] Gst.DebugMessage
0:01:37.743912500 37840 000002CAACEFB400 WARN                 basesrc gstbasesrc.c:3132:gst_base_src_loop:<udpsrc6> error: streaming stopped, reason not-linked (-1)
0:01:37.747616100 37840 000002CAACEFB400 DEBUG                rtspsrc gstrtspsrc.c:9299:gst_rtspsrc_handle_message:<rtspsrc0> got error from udpsrc6
0:01:37.749608400 37840 000002CAACEFB400 DEBUG                rtspsrc gstrtspsrc.c:9313:gst_rtspsrc_handle_message:<rtspsrc0> combined flows: not-linked
21:08:10.448 [37840:11] [WRN] [myapp] GLib.GException: Internal data stream error.
GLib.GException: Internal data stream error.
0:01:38.872434400 37840 000002CAACEFBF80 DEBUG                rtspsrc gstrtspsrc.c:3775:on_ssrc_active:<rtspsrc0> source in session 0 is active

Thanks in advance.

how do you code your pipeline? I guess you need to add bus error handling. When the connection is broken, you will be able to get bus error and then try to rerun your pipeline(maybe with a timer). I do not recreate my pipeline. Instead, I stop the pipeline and restart it.

Hi, thank you for reply.

Yes, sure, I’ve subscribed to bus messages. And here is code to restart pipeline in order to handle either Eos or Error:

Pipeline.SetState(State.Null);
Pipeline.SetState(State.Ready);
Pipeline.SetState(State.Playing);

I use gst 1.22 or higher.

Maybe I should create new rtspsrc element?

It could be the case that your pipeline is not cleared completely. I guess you will get this message if you do not restart the pipeline after the connection is off. It may take about 10s or so. I added a probe to my pipeline if the gap of two frames is over 4s, the pipeline will be stopped immediately. Then you may need to add some probe to check if the source is available. Restart your pipeline if probe is positive. Someone recommended TCP to me for this.

Try to flush your pipeline before restart?

I added a probe to my pipeline if the gap of two frames is over 4s, the pipeline will be stopped immediately.

Interesting solution, but why you don’t use(handle) messages like Error or Eos? Can you share some sample?

Try to flush your pipeline before restart?

You mean send event like:
RtspPipeline.SendEvent(Event.NewFlushStart());

Should I also emit StopFlush? Should it be done after pipeline Ready state?

Sorry, I am not allowed to give you the code. The error may come a bit later and the last frame will stay there(not wanted and therefore the probe closes the display in 4s). EOS will never come since streaming is broken and not stopped.

if ( GST_STATE_PLAYING == current_state ) {
    /* flush the pipeline if pipeline is running */
    gst_element_set_state( GST_ELEMENT( pipeline ), GST_STATE_PAUSED );
    gst_element_get_state( GST_ELEMENT( pipeline ), NULL, NULL, GST_CLOCK_TIME_NONE );
}

Thank you for reply.
I got error or Eos message, and add flushing (not sure if it is correct):

                    RtspPipeline.SendEvent(Event.NewFlushStart());
                    RtspPipeline.SendEvent(Event.NewFlushStop(true));
                   
                    RtspPipeline.SetState(State.Null);
                    RtspPipeline.SetState(State.Ready);
                    RtspPipeline.SetState(State.Playing);

but still it doesn’t work.