I am developing a deep stream inference application with multiple RTSP sources.
Where each individual source is constructed using uridecodebin plugin. Until this point, I have developed a pipeline with multiple source bins connected to nvstreammux and then goes the typical inference pipeline as per our use case something like this.
source-bin-1 --|—| nvstreammux |—| nvinfer |----| nvmsgbroker |
Which is working totally fine!
I am looking to incorporate RTSP reconnection in case any of the RTSP sources (camera) is down for a while and comes up after some time.
For this, I am referring deepstream-app and deepsteram-test5 examples. But The logic for reconnection in these examples are only restricted to source-bin having rtspsrc and decodebin plugins. It is not implemented for uridecodebin.
After referring to the deepstream-app and deepsteram-test5 examples I have tried implementing the same logic in my application.
In case of source error, I am setting a particular uridecodebin state to NULL and then to PLAY again.
My observations after performing some test cases are:
- When I am using [rtspsrc-decodebin] as the source-bin my reconnection logic of setting the state to NULL and PLAY works fine and I am able to reconnect to my RTSP source successfully. Here when I set the source-bin state to PLAY it returns me GST_STATE_CHANGE_ASYNC and the source-bin is able to provide frames to the upstream elements.
- But In the case of [uridecodebin] as the source-bin, my same reconnection logic does not work. Here the observation is after I set the source-bin state to PLAY it returns me GST_STATE_CHANGE_NO_PREROLL and my overall pipeline gets stuck. It is not giving me the further error of source disconnected but also not able to provide frames to the upstream elements.
The main difference I can conclude here is that when I am using uridecodebin and changing state to PLAY it is returning with GST_STATE_CHANGE_NO_PREROLL and I am able to reconnect, while with rtspsrc it is returning GST_STATE_CHANGE_ASYNC and I am able to connect.
I am seeking help to successfully reconnect to my RTSP source when I am using uridecodebin as the source-bin.
Thank you in advance!!