[FFmpeg-devel] Longevity Test Report

Mike Melanson mike
Tue Feb 3 06:59:41 CET 2009

Pursuant to recent discussions, I tried decoding a full movie using 
FFmpeg. No transcoding yet, just decoding. I used this command:

ffmpeg -i <movie> -f framecrc - > /dev/null

With a 100-minute AVI/MPEG-4/MP3 movie, the file decoded at a consistent 
1100-1200 fps on my Core 2 Duo machine (single-threaded operation) and 
finished in 2 minutes in repeated tests. Monitoring the process via 
'top' shows a non-changing amount of memory usage.

A 92-minute MPG/MPEG-1/MP2 movie decoded without any memory trouble.

Not as much luck with a 115-minute MP4/H.264/AAC movie, though. On the 
same machine, the decoding starts strong at over 200 fps and gradually 
decreases. Monitoring the process via 'top' shows a steadily increasing 
slice of the 2 GB of RAM being used. When decoding got down to about 40 
fps, I pressed 'q' to quit, but FFmpeg never really felt like quitting 
and I had to use harsher quit methods.

When running the command prepended with 'valgrind --leak-check=full 
--show-reachable=yes', the only problem the memory checker finds is at 
the start of ffmpeg.c:main():

     for(i=0; i<CODEC_TYPE_NB; i++){
         avctx_opts[i]= avcodec_alloc_context2(i);

I guess those contexts are never freed. But that doesn't account for any 
major memory leaks.

Oddly, I downloaded a 6-minute MOV/H.264/AAC 1080p movie 
trailer/featurette and it decoded without any notable memory problems.

     -Mike Melanson

More information about the ffmpeg-devel mailing list