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

Simone Donadini Simone.Donadini at avolites.com
Thu Mar 14 13:51:49 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.

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.

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

With our codec one encoded frame 7680x4320 should be ~100MB.

> > 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.)

At the moment i am testing with a file h264 8K @60fps, and the encoder is using the same properties (framerate - size) of the source file. I am using no filters.

> 
> > Or building a 64bit version would fix this issue?
> 
> Most likely.
> 
> Carl Eugen
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list