Use the h264_nvmpi hardware decoder to decode H264 experiences a memory leak

I use the h264_nvmpi hardware decoder to decode When working with H264 files, I found that the process is experiencing a memory leak, and the size of the memory leak is increasing over time. How can I solve this problem?

May I know which Jetson platform and JetPack SW you’re using now?

Module: NVIDIA Jetson Orin NX
Jetpack: 6.2.1

Hi,
On Jetson platforms, we have h264_nvv4l2dec in ffmpeg. Please refer to developer guide and the forum posts:
Accelerated Decode with ffmpeg — NVIDIA Jetson Linux Developer Guide
Jetson AGX Orin FAQ
Ffmpeg failed to decode with h264_nvv4l2dec, Segmentation fault! - #6 by DaneLLL

But I am using the h264_nvmpi codec, and the information you provided does not seem to solve the memory leak issue I mentioned.

Hi,
We don’t validate h264_nvmpi on Jetson platforms, so it is possible to have potential issue. Would suggest use the software stack which is validated in our SQA coverage.

I only found two hardware codecs, h264_nvmpi and h264-v4l2m2m. How do I install and use h264_nvv4l2dec? Do you have detailed documentation to provide?

Module: NVIDIA Jetson Orin NX (16GB ram), Jetpack: 6.2.1

Hi,
There are steps in above links. Please follow it and give it a try.

I reinstalled Jetson and the entire set of components using SDKM, and now I can use the h264_nvv4l2dec codec. However, when I decode with it, I found that the process still experiences memory leaks.

Hi,
Please share a test sample. We would like to replicate the issue you are seeing on developer kit and check.