Gstreamer RTSP server detect client disconnect


Using the RTSP server example from Jetson nano FAQ

Is there a way to detect when a client disconnects from the server?

I don’t have my development tools with me now so I can’t explore. This is something I will work on asap once I am able to work on my hardware.

I am looking for any helpful suggestion that may lead me toward the right path.

I’ve found that going through the gstreamer api docs can be a little overwhelming so any direction would be helpful.

Thank you.

I’ve found that


returns an object that keeps track of current sessions. I guess I just need to continuously check the return of this function to see if there are no active sessions.

I solved the problem by adding a call back to the main context used for the server. Then I needed to add appropriate logic and functions to detect when client disconnects and to properly shutdown the infinite loop.

1 Like

Good to know you resolve it and thanks for the sharing.

1 Like