[FFmpeg-user] ffmpeg: h264 encoding excessive memory usage (leakage?) and max_alloc

Ziggy Stardust zstardustn1 at gmail.com
Thu Feb 7 09:33:04 CET 2013

Hi guys,

I noticed a possible memory leak in h264 encoder, and if not so at least a huge memory usage. 
I feed ffmpeg from a named pipe, and the command line is:

ffmpeg -y -r 5 -g 20 -max_alloc 100000000 -an -pix_fmt rgb32 -s 1298x994 -f rawvideo -i \\.\Pipe\VideoCapture.00000dec.00000000.rw -f flv -vcodec h264 ".\\video.flv"

The amount of memory raises quickly (in some seconds) to 300MB of RAM, and then stays nearby.
I need to limit it around 50-75MB because I am using a low resources appliance.
Trying to limit the maximum allocation with "-max_alloc 100000000" option has no effect, also
limiting the I-frame frequency with low gop setting does not help.

As a reference if I use flv codec instead of h264, the memory usage is about 50MB (6x less).

Can you please gimme some hints?

Thanks in advance!

More information about the ffmpeg-user mailing list