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

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Mar 15 01:36:03 EET 2019


2019-03-14 12:51 GMT+01:00, Simone Donadini <Simone.Donadini at avolites.com>:
>> 2019-03-14 11:28 GMT+01:00, Simone Donadini
>> <Simone.Donadini at avolites.com>:

>> > 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.
>
> ok, i will try with it. But i am not seeing any memory leak with smaller
> files, so i am not sure why there would be any when using a greater
> resolution.

massif does not detect memory leaks, so I don't understand your
comment.

>> > 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,

I forgot:
Of course it does.

>>> but even with a 8K frame using >4GB is not expected.
>>
>> Why do you think so?
>
> With our codec one encoded frame 7680x4320 should be ~100MB.

No, memory requirements can be >3G (You did not give enough
information about input video and encoder settings, "same
properties" are not valid settings).

Carl Eugen


More information about the ffmpeg-devel mailing list