<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I put the cut down example to the github. Please check and tell whats wrong. (No qt actually needed for compiling. just remove all Q-things and itll run). I just use Qt creator alot.<div class="">I think if I solve this issue, this should be put to the Application developers manual. As there is no example about “catching” error from element and then synchronizing what comes next.<div class=""><br class=""></div><div class=""><a href="https://github.com/tonuj/teststream.git" class="">https://github.com/tonuj/teststream.git</a></div><div class=""><br class=""></div><div class="">Tõnu</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 30 Aug 2017, at 10:25, Tonu Jaansoo <<a href="mailto:tonu.jaansoo@gmail.com" class="">tonu.jaansoo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hm<br class=""><br class="">By catching error on the bus you mean relinking the pipeline with fakesinks, or do I have to do anything else like acknowledge or drop this message?<br class="">Also can I remove all elements from bus callback and relink and set PLAYING states (same thread)?  Bus callback runs in main thread.<br class=""><br class="">When I remove something from bin while playing and without any blocking probes, doesn't this create a situation where pipeline sometimes just crash? <br class=""><br class="">I have attached very ugly hack that <br class=""><br class="">* Creates pipeline where it writes to file and to rtspclientsink. Rtspclientsink connects to the server.<br class="">* After startup, i quicly shut down rtsp server<br class="">* When rtspclientsink generates error on bus, I replace audio and video branches with fakesinks.. (this works sometimes and rest of the pipeline still writing to file)<br class="">* After 30s timeout from startup, from callback I try to replace fakesinks with the pipeline that originally was in place. This has worked once … dont know what I was doing :-D<br class=""><br class="">Tõnu<br class=""><br class=""><br class=""><span id="cid:3A32E9EC-0C5E-45BE-B484-7ACC2B017B48@homerouter.cpe"><gst.cpp></span><span id="cid:AF25F173-0FBB-4783-9317-4636BF450430@homerouter.cpe"><gst.h></span><br class=""><br class=""><br class=""><blockquote type="cite" class="">On 28 Aug 2017, at 20:50, Tim Müller <<a href="mailto:tim@centricular.com" class="">tim@centricular.com</a>> wrote:<br class=""><br class="">On Wed, 2017-08-23 at 14:08 +0300, Tonu Jaansoo wrote:<br class=""><br class="">Hi Tonu,<br class=""><br class=""><blockquote type="cite" class="">(snip pipeline)<br class=""><br class="">Now this commandline has problem. When internet connection fails for<br class="">a second, rtspclientsink tears down everything - also writing to<br class="">files. I want that when internet fails, audio+video is still being<br class="">captured into files. Currently I have different commandline without<br class="">rtspclientsink branches that I use when there is no internet.<br class=""><br class="">I am trying to rewrite this in C, but so that I intercept<br class="">rtspclientsink having no connection and dynamically unpluging RTSP<br class="">branches of the pipeline.<br class=""><br class="">Something like this is correct way to do it?<br class=""><br class="">* wait on bus for error message from rtspclientsink<br class="">* when error comes, set all elements from q1 and q3 to rtspclientsink<br class="">to NULL<br class="">* also remove those elements from bin<br class="">* wait 10s to retry connection<br class="">* dynamically add all elements that were removed <br class="">* set set their status to PLAYING<br class=""><br class="">I have tried something like this. I get no errors, but no luck<br class="">getting stream going.<br class=""></blockquote><br class="">There are two parts to this:<br class=""><br class="">1) catching the error message on the bus in your application, and then<br class="">doing something smarter than just stopping the entire pipeline; and<br class=""><br class="">2) making sure that a 'flow error' return from rtspclientsink doesn't<br class="">make the upstream elements stop streaming.<br class=""><br class="">There is an 'errorignore' element that can do 2. You'll want one of<br class="">those in each branch before the rtspclientsink. When an error happens<br class="">you should be able to unlink the sink and stop it, and then restart it<br class="">and re-link. The errorignore element will make sure the error flow<br class="">return is not propagated to the rest of the pipeline.<br class=""><br class="">Cheers<br class="">-Tim<br class=""><br class="">-- <br class="">Tim Müller, Centricular Ltd - <a href="http://www.centricular.com" class="">http://www.centricular.com</a><br class=""><br class="">Join us at the GStreamer Conference!<br class="">21-22 October 2017 in Prague, Czech Republic<br class=""><a href="http://gstreamer.freedesktop.org/conference/" class="">http://gstreamer.freedesktop.org/conference/</a><br class="">_______________________________________________<br class="">gstreamer-devel mailing list<br class="">gstreamer-devel@lists.freedesktop.org<br class="">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br class=""></blockquote><br class="">_______________________________________________<br class="">gstreamer-devel mailing list<br class=""><a href="mailto:gstreamer-devel@lists.freedesktop.org" class="">gstreamer-devel@lists.freedesktop.org</a><br class="">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>