<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<br><div><br></div><div>I am trying to implement in my C application a mechanism to restart the rtspsrc - splitmuxsink pipeline whenever RTSP server has network issues.</div><div><div><br></div><div>I have referred to one of the earlier posts:</div><div><a href="http://gstreamer-devel.966125.n4.nabble.com/Resuming-rtsp-stream-on-receiving-EOS-signal-on-message-bus-using-re-connection-timer-SOLVED-td4658402.html">http://gstreamer-devel.966125.n4.nabble.com/Resuming-rtsp-stream-on-receiving-EOS-signal-on-message-bus-using-re-connection-timer-SOLVED-td4658402.html</a></div></div><div><br></div><div><br></div><div>I have two cases to handle</div><div>1. RTSP server not available right from beginning of application<br></div><div>2. RTSP server available in the beginning but lost connection during run time </div><div><br></div><div><div>In case 1:</div><div>Once GST_MESSAGE_ERROR occurs, I switch the pipeline state to GST_STATE_NULL, sleep for a couple seconds delay then immediately switch to GST_STATE_PLAYING.The bus gets GST_MESSAGE_ERROR and the pipeline gets restarted in a loop from starting until the RTSP server comes online. Once the RTSP server is online the error messages stop and the pipeline runs successfully and splitmuxsink is able to create segment files as expected.</div></div><div><br></div><div>In case 2:</div><div>Once the EOS message occurs in the message bus watcher thread, I switch the pipeline state to GST_STATE_NULL, sleep for a couple seconds delay then immediately switch to GST_STATE_PLAYING. Upon this the bus further gets GST_MESSAGE_ERROR and the pipeline gets restarted in a loop until the RTSP server comes back online (same as case 1). Once the RTSP server is online the error messages stop but the data does not seem to flow down the pipeline. The gst_bus_timed_pop() keeps getting TIMEDOUT.</div><div><br></div><div>Please note that there is no main loop running after the initial pipeline start, the application relies on the separate thread for watching the bus messages using gst_bus_timed_pop()<br></div><div><br></div><div><br></div><div>Here is the code for the thread which handles bus messages : <a href="https://pastebin.com/MDbwgtsm">https://pastebin.com/MDbwgtsm</a></div><div><br></div><div>I suspect the elements are not being linked properly after we restart a pipeline upon EOS. But not able to clearly identify which are those elements.   <br></div><div>Please can some one suggest what is most efficient way to resume a pipeline upon EOS and let it keep retrying until the RTSP server comes back online.</div><div><br></div><div>Gstreamer version - 1.14.1</div><div><br></div><div>Thanks</div><div>Tarun</div><div> <br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div></div></div>