[FFmpeg-user] some containers require "monotonically increasing" RAM expected or leak (mp4, nut)?

Roger Pack rogerdpack2 at gmail.com
Mon Jan 4 19:07:07 CET 2016

Hello all.
I noticed when doing some test to isolate memory leaks that the
following commands "grow monotonically" (RAM size required) however
valgrind doesn't report any leaks.  I presume this is expected?

** nut container size grows over time:
   ./ffmpeg -f lavfi -i color=c=red:size=40x40 -vcodec rawvideo -f nut
-y /dev/null
** mp4 container size grows over time:
    ./ffmpeg -f lavfi -i color=c=red:size=40x40 -vcodec libx264
-preset ultrafast  -f mp4 -y /dev/null

The reason I'm asking is, now that FFmpeg has things like avdevice
captures, some users may want to capture live digital video for "quite
awhile."  Assuming a capture (30 fps) is around 3M frames "a day," and
the above mp4 command dies [out of memory] for me after 33M frames, so
(assuming a 32 bit exe) it seems capture is limited to at most 11 days
with mp4 container.  "nut" container is better (uses far less RAM but
still eventually would run out), "mpeg" container, however, doesn't
seem to use much RAM at all (doesn't grow).  So I assume mpeg is a
good option in this case, or possibly the segment muxer so output
video files don't end up containing too many frames?)
Thank you.

More information about the ffmpeg-user mailing list