Memory increase when dynamic change source element

device:jetson nano
jetpack:4.4 [L4T 32.4.3]

gst-url: rtspsrc location=rtsp://admin:admin123@172.23.240.20:554/cam/realmonitor?channel=1&subtype=0 latency=0 drop-on-latency=true ! rtph264depay ! h264parse ! nvv4l2decoder ! nvvidconv ! video/x-raw, format=(string)NV12 ! appsink emit-signals=true sync=false max-buffers=1 drop=true

there are six ipcam running gst in my nano through multi-thread;but when there are ten ipcam(larger than six) then will dynamic change source element in a circle;

key code is:
self.imageArr = None
self.source.set_state(Gst.State.NULL)
self.source.unlink(self.depay)
self.pipeline.remove(self.source)
del self.source
self.create_source_element(self.camera.rtspUrl)
self.pipeline.add(self.source)
sink_pad = self.depay.get_static_pad(‘sink’) # or a request pad
self.source.connect(‘pad-added’, ModelPreRulesService.on_pad_added, sink_pad)
self.source.set_state(Gst.State.PLAYING)

memory increase while dynamic change source element

have any solution?

Hi,
This is not a verified use-case and it may not work properly. When the source is changed, is the decoder re-initialized?

And we would suggest destroy the whole pipeline, and re-initialize it.

https://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html?gi-language=c
I refer to this above;

nearly every several second we will change the location of rtspsrc,is it too often to re-initialize a pipeline

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.