Memory leak when using MJPEG RTSP stream in Deepstream SDK 4.0.1

• Hardware Platform (Jetson / GPU)
: Jetson Nano
• DeepStream Version
: DS 4.0.1
• JetPack Version (valid for Jetson only)
: Jetpack 4.2.2

Hello.
I am trying to receive mjpeg rtsp stream from camera using Deepstream.
By the way, after the project runs, the gpu memory keeps increasing.
Then the jetson board is forcibly terminated.
I checked other forums with the same problem, and I saw a post saying that replacing nvjpecdec with nvv4l2decoder will solve it.
Or, in deepstream_source_bin.c, I saw an article saying that you can set the mjpeg property to 1 in the cb_rtspsrc_select_stream function, but I could not solve it.

How can I use MJPEG RTSP stream in Deepstream 4.0.1 SDK without memory leak?

How can I change Decoder nvjpegdec to nvv4l2decoder?
Need to change the source code?

DS4.0.1 is not supported now. Can you upgrade to latest DeepstreamSDK 5.0.1 first? https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Quickstart.html
With DeepStream5.0.1, you can use the nvv4l2decoder with “mjpeg=1” property to decode mjpeg stream.

Fiona.chen Thank you for your answer.

How can I change mjpeg properties using nvv4l2decoder?

It is just a normal property of nvv4l2decoder plugin, you can check its description with “gst-inapect-1.0 nvv4l2decoder” command on your Jetson board.

Yes I checked with that command.
The default value of mjpeg is false.
I am new to gstreamer.
How can I change the property of mjpeg to 1?

There are sample codes in DeepStreamSDK package. The element property setting is “g_object_set” function, it exists in almost every sample app source codes. Please check the sample codes.

Or you can start with gstreamer guide first. https://gstreamer.freedesktop.org/documentation/tutorials/basic/concepts.html?gi-language=c

There are a lot resources in internet for gstreamer programming.