[FFmpeg-devel] 32bit transcoding app running out of memory

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu Mar 14 12:34:53 EET 2019


2019-03-14 11:28 GMT+01:00, Simone Donadini <Simone.Donadini at avolites.com>:
> Hi there,
> we are developing a transcoder using ffmpeg based on the transcoding example
> https://www.ffmpeg.org/doxygen/4.1/transcoding_8c-example.html and we are
> encountering some problem with memory usage transcoding files with large
> resolutions.
> When transcoding 4K files, the memory usage will go up to 3.4GB but then it
> will stay steady for the rest of the conversion, and clean every thing at
> the end.

massif (or an equivalent application) can tell you where the memory
is allocated, some decoders absolutely need these allocations, apart
from that my guess is that (a part of) the allocation does not happen
in FFmpeg.

> While transcoding video files with larger resolution (8K) the app,
> which is 32bit, will run out of memory (>4GB).
> It does not look like a memory leak, as memory usage will grow as long as
> transcoding a certain amount of frames and then it will stay steady. It
> looks like the amount of memory usage depends on the resolution of the

> frame, but even with a 8K frame using >4GB is not expected.

Why do you think so?

> Is this a known behavior?
> Is there a way to limit the number of frames loaded on memory
> or the amount of memory while transcoding?

Yes.
(You did not give enough information about input video and
encoder settings.)

> Or building a 64bit version would fix this issue?

Most likely.

Carl Eugen


More information about the ffmpeg-devel mailing list