Dynamically adding and removing RTSP streams in deepstream using Python

I am trying to dynamically add and remove RTSP streams in deepstream using Python. There’s a repo by Nvidia which supports it but It is in C. I want to implement it using python. Should I try to refactor the code into python or is there any other way or an interface that I can use to run C code snippet using python?

Usecase: Deepstream application will read about new streams RTSP links from Firebase and will add new streams to the pipeline. I want to add it dynamically without restarting the pipeline completely.

PS. It is a very important use case as without it no product will be completely functional. If we can’t do it as of now then what do you recommend, should we convert our complete pipeline from python to c?

• Hardware Platform (Jetson / GPU) T4
• DeepStream Version 5.01

You need to implement the functions in python. gst-python is provided by gstreamer project. https://gstreamer.freedesktop.org/bindings/python.html. There is very limited resources for gst-python.
This link may be helpful. Python GStreamer Tutorial

The decision should be based on your own requirement and knowledge base. For the common sense, c is more efficient and there are more c resources(documents, 3rd party samples) than python.

Thank you for your reply. I was able to convert C code to python.