Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak #1

Open
123lifei opened this issue Jul 20, 2022 · 6 comments
Open

memory leak #1

123lifei opened this issue Jul 20, 2022 · 6 comments

Comments

@123lifei
Copy link

could you find memory leak Slowly when you use decode named h264_nvv4l2dec?

@LinusCDE
Copy link
Owner

LinusCDE commented Jul 20, 2022

I have not used that decoder extensively, so I didn't notice that. The decoder is the official submitted by nvidia employees to the ffmpeg mailinglist afaik (link should be in readme).

That would probably be an issue on their side then. For decode, I would recommend the nvmpi variant anyways, since it seemed a bit more performant (but the nvidia one supports some other pixel formats).

So this is probably not in my scope to fix, as I just repackaged other en-/decoders here. If there is an updated patch that fixes it, let me know.

@xsacha
Copy link

xsacha commented Sep 21, 2022

The official nvidia one has received update to 4.2.2.1 (23 May 2021) by the way. There's a Ubuntu 20 build too, 4.2.7 (21 July 2022).
I believe you are using the 2020 version here.

$ echo "deb https://repo.download.nvidia.com/jetson/ffmpeg main main" | sudo tee -a /etc/apt/sources.list
$ echo "deb-src https://repo.download.nvidia.com/jetson/ffmpeg main main" | sudo tee -a /etc/apt/sources.list
$ sudo apt update
$ sudo apt install ffmpeg

@LinusCDE
Copy link
Owner

I have not yet managed to migrate to a firmware with Ubuntu 20.04. The version used here should work fine as long as libs are not too out of date. In that case compiling it yourself would solve it.

The ffmpeg version itself isn't intended to mirror the one available from apt. If it's too out of date, I can probably update it sometime in the future. Right now I just cannot provide a build on the newest version and compatible with the newest jetpack release (if there is a mismatch) due to time constrains I'll have for a few months at least.

Maybe I'll find the time, to at least update to the mentioned (or whatever the current release) is. I heavily doubt that for now though. (PRs are also always welcome. The way I did it should be described in the readme.)

Or did you want to imply that theirs now also includes their hw acceleration? That would be awesome.

@xsacha
Copy link

xsacha commented Oct 5, 2022

Just a note, I think I get the leak you mention on the newer version (4.2.2.1) for Ubuntu 18. However, I have not tested the Ubuntu 20 version.
It's a very slow leak right? It appears invisible to the process, although top shows it associated with the process. I found the number increasing is in:

$ cat /proc/meminfo
...
NvMapMemFree: 0 kB
NvMapMemUsed: 1559860 kB
...

When I switch back to jetson-ffmpeg, the number appears stable. I remember this bug occurring in an earlier version of jetson-ffmpeg.

Edit: I discovered a fix here https://gitlab.com/switchroot/switch-l4t-multimedia/FFmpeg/-/commit/deac819ac20d2ccd1664c95e4d91c20a35d67cc5
It's a different one though.

@LinusCDE
Copy link
Owner

I'm finally now getting to fully re-install my jetson with the newest OS/SDK. So will try to incoperate the fix there ig the following days / week (if I find time and motivation for it).

This means that I can't test the old version based on Ubuntu 18.04 anymore. I'll probably make the old instructions collapsible / reachable over a separate branch and mention this patch, so people can try to include it themselves.

@LinusCDE
Copy link
Owner

The leak should be fixed with commit 6b4170f.

I'm currently on making a new release based on ffmpeg 6.0. I so far managed to get most patches migrated to 6.0 as the api seems to have changed quite a bit. However I still have an issue where using the h264_nvmpi encoder spams the message Error while dequeing buffer from output plane (I have not tested h265 yet).

The error seems the be thrown here but I still need to figure out why that happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants