Restart RSTP pipeline upon EOS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Restart RSTP pipeline upon EOS

Tarun Tej K
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 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
 










_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Restart RSTP pipeline upon EOS

hsakaria
Hi,

I'm facing the same issue.

Did you ever figure out the issue and solution?




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel