Restart RSTP pipeline upon EOS

Tarun Tej K tarun4690 at gmail.com
Mon Apr 22 13:42:22 UTC 2019


Hi,

I am trying to implement in my C application a mechanism to restart the
rtspsrc - splitmuxsink pipeline whenever RTSP server has network issues.

I have referred to one of the earlier posts:
http://gstreamer-devel.966125.n4.nabble.com/Resuming-rtsp-stream-on-receiving-EOS-signal-on-message-bus-using-re-connection-timer-SOLVED-td4658402.html


I have two cases to handle
1. RTSP server not available right from beginning of application
2. RTSP server available in the beginning but lost connection during run
time

In case 1:
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.

In case 2:
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.

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()


Here is the code for the thread which handles bus messages :
https://pastebin.com/MDbwgtsm

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.
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.

Gstreamer version - 1.14.1

Thanks
Tarun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190422/8638707f/attachment.html>


More information about the gstreamer-devel mailing list