[FFmpeg-user] High memory usage when merging videos

Jonathan Girven jonathan.girven at trickbook.com
Mon Dec 19 17:50:10 EET 2016

>> Otherwise there isn't much I can do to improve my FFmpeg
>> command?
> I wonder if the (input?) option "-re" can improve your situation...

As I understand it, the "-re" option instructs FFmpeg to read the
input file at the native frame rate of the file, rather than as fast
as possible. So the idea would be to slow down the rate at which the
memory fills with frames waiting to be processed in the hope that the
complex filters can empty the buffer quickly enough to avoid the out
of memory problems. Am I right?

Testing this by adding "-re" before each "-i", I am still experiencing
the same out of memory issues. The speed that FFmpeg quotes it is
working at is around 0.200x. So in the time 20% of the output file has
been processed, the inputs have been entirely loaded, 80% of which
still unprocessed in memory. Is that how it works? It is pretty hacky,
but I guess if I could specify the rate at which inputs are loaded
precisely, I could specify fps*0.2, and it would work. Maybe by
temporarily changing the frame rate ...

More information about the ffmpeg-user mailing list