<div dir="ltr">Problem: Huge memory leak is seen when using libvmaf filter. <div><br></div><div>Note: The command uses "-vframes 10" as I wanted to limit the log size. Please run the command without "-vframes" and check the output of "top" command to reproduce the issue.</div><div><br></div><div>Command to reproduce the issue:</div><div>ffmpeg started on 2017-11-09 at 17:08:39<br></div><div><div>Report written to "ffmpeg-20171109-170839.log"</div><div>Command line:</div><div>./ffmpeg -v 9 -loglevel 99 -report -f lavfi -i testsrc2 -f lavfi -i testsrc2 -vframes 10 -lavfi "libvmaf=model_path=model/vmaf_v0.6.1.pkl" -f null -</div><div>ffmpeg version N-88671-g7b7775a604-static <a href="https://johnvansickle.com/ffmpeg/">https://johnvansickle.com/ffmpeg/</a>  Copyright (c) 2000-2017 the FFmpeg developers</div><div>  built with gcc 6.4.0 (Debian 6.4.0-9) 20171026</div><div>  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg</div><div>  libavutil      56.  0.100 / 56.  0.100</div><div>  libavcodec     58.  1.100 / 58.  1.100</div><div>  libavformat    58.  2.100 / 58.  2.100</div><div>  libavdevice    58.  0.100 / 58.  0.100</div><div>  libavfilter     7.  0.101 /  7.  0.101</div><div>  libswscale      5.  0.101 /  5.  0.101</div><div>  libswresample   3.  0.101 /  3.  0.101</div><div>  libpostproc    55.  0.100 / 55.  0.100</div><div>Splitting the commandline.</div><div>Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.</div><div>Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.</div><div>Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.</div><div>Reading option '-f' ... matched as option 'f' (force format) with argument 'lavfi'.</div><div>Reading option '-i' ... matched as input url with argument 'testsrc2'.</div><div>Reading option '-f' ... matched as option 'f' (force format) with argument 'lavfi'.</div><div>Reading option '-i' ... matched as input url with argument 'testsrc2'.</div><div>Reading option '-vframes' ... matched as option 'vframes' (set the number of video frames to output) with argument '10'.</div><div>Reading option '-lavfi' ... matched as option 'lavfi' (create a complex filtergraph) with argument 'libvmaf=model_path=model/vmaf_v0.6.1.pkl'.</div><div>Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.</div><div>Reading option '-' ... matched as output url.</div><div>Finished splitting the commandline.</div><div>Parsing a group of options: global .</div><div>Applying option v (set logging level) with argument 9.</div><div>Applying option loglevel (set logging level) with argument 99.</div><div>Applying option report (generate a report) with argument 1.</div><div>Applying option lavfi (create a complex filtergraph) with argument libvmaf=model_path=model/vmaf_v0.6.1.pkl.</div><div>Successfully parsed a group of options.</div><div>Parsing a group of options: input url testsrc2.</div><div>Applying option f (force format) with argument lavfi.</div><div>Successfully parsed a group of options.</div><div>Opening an input file: testsrc2.</div><div>detected 8 logical cores</div><div>[Parsed_testsrc2_0 @ 0x573e8c0] size:320x240 rate:25/1 duration:-1.000000 sar:1/1</div><div>[AVFilterGraph @ 0x573d360] query_formats: 2 queried, 1 merged, 0 already done, 0 delayed</div><div>[lavfi @ 0x573c9c0] All info found</div><div>Input #0, lavfi, from 'testsrc2':</div><div>  Duration: N/A, start: 0.000000, bitrate: N/A</div><div>    Stream #0:0, 1, 1/25: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 0/1, 25 tbr, 25 tbn, 25 tbc</div><div>Successfully opened the file.</div><div>Parsing a group of options: input url testsrc2.</div><div>Applying option f (force format) with argument lavfi.</div><div>Successfully parsed a group of options.</div><div>Opening an input file: testsrc2.</div><div>[Parsed_testsrc2_0 @ 0x577d200] size:320x240 rate:25/1 duration:-1.000000 sar:1/1</div><div>[AVFilterGraph @ 0x5740b40] query_formats: 2 queried, 1 merged, 0 already done, 0 delayed</div><div>[lavfi @ 0x577b860] All info found</div><div>Input #1, lavfi, from 'testsrc2':</div><div>  Duration: N/A, start: 0.000000, bitrate: N/A</div><div>    Stream #1:0, 1, 1/25: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 0/1, 25 tbr, 25 tbn, 25 tbc</div><div>Successfully opened the file.</div><div>[Parsed_libvmaf_0 @ 0x57baa60] Setting 'model_path' to value 'model/vmaf_v0.6.1.pkl'</div><div>Parsing a group of options: output url -.</div><div>Applying option vframes (set the number of video frames to output) with argument 10.</div><div>Applying option f (force format) with argument null.</div><div>Successfully parsed a group of options.</div><div>Opening an output file: -.</div><div>Successfully opened the file.</div><div>Stream mapping:</div><div>  Stream #0:0 (rawvideo) -> libvmaf:main</div><div>  Stream #1:0 (rawvideo) -> libvmaf:reference</div><div>  libvmaf -> Stream #0:0 (wrapped_avframe)</div><div>Press [q] to stop, [?] for help</div><div>cur_dts is invalid (this is harmless if it occurs once at the start per stream)</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>cur_dts is invalid (this is harmless if it occurs once at the start per stream)</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[Parsed_libvmaf_0 @ 0x57bffc0] Setting 'model_path' to value 'model/vmaf_v0.6.1.pkl'</div><div>[graph 0 input from stream 0:0 @ 0x57c0c80] Setting 'video_size' to value '320x240'</div><div>[graph 0 input from stream 0:0 @ 0x57c0c80] Setting 'pix_fmt' to value '0'</div><div>[graph 0 input from stream 0:0 @ 0x57c0c80] Setting 'time_base' to value '1/25'</div><div>[graph 0 input from stream 0:0 @ 0x57c0c80] Setting 'pixel_aspect' to value '1/1'</div><div>[graph 0 input from stream 0:0 @ 0x57c0c80] Setting 'sws_param' to value 'flags=2'</div><div>[graph 0 input from stream 0:0 @ 0x57c0c80] Setting 'frame_rate' to value '25/1'</div><div>[graph 0 input from stream 0:0 @ 0x57c0c80] w:320 h:240 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2</div><div>[graph 0 input from stream 1:0 @ 0x57c19c0] Setting 'video_size' to value '320x240'</div><div>[graph 0 input from stream 1:0 @ 0x57c19c0] Setting 'pix_fmt' to value '0'</div><div>[graph 0 input from stream 1:0 @ 0x57c19c0] Setting 'time_base' to value '1/25'</div><div>[graph 0 input from stream 1:0 @ 0x57c19c0] Setting 'pixel_aspect' to value '1/1'</div><div>[graph 0 input from stream 1:0 @ 0x57c19c0] Setting 'sws_param' to value 'flags=2'</div><div>[graph 0 input from stream 1:0 @ 0x57c19c0] Setting 'frame_rate' to value '25/1'</div><div>[graph 0 input from stream 1:0 @ 0x57c19c0] w:320 h:240 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2</div><div>[AVFilterGraph @ 0x57bf2e0] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed</div><div>[Parsed_libvmaf_0 @ 0x57bffc0] [framesync @ 0x57c00c8] Selected 1/25 time base</div><div>[Parsed_libvmaf_0 @ 0x57bffc0] [framesync @ 0x57c00c8] Sync level 2</div><div>Output #0, null, to 'pipe:':</div><div>  Metadata:</div><div>    encoder         : Lavf58.2.100</div><div>    Stream #0:0, 0, 1/25: Video: wrapped_avframe, 1 reference frame, yuv420p, 320x240 [SAR 1:1 DAR 4:3], 0/1, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)</div><div>    Metadata:</div><div>      encoder         : Lavc58.1.100 wrapped_avframe</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x5740700] PACKET SIZE: 115200, STRIDE: 480</div><div>[rawvideo @ 0x57b96e0] PACKET SIZE: 115200, STRIDE: 480</div><div>No more output streams to write to, finishing.</div><div>[Parsed_libvmaf_0 @ 0x57bffc0] [framesync @ 0x57c00c8] Sync level 1</div><div>[Parsed_libvmaf_0 @ 0x57bffc0] [framesync @ 0x57c00c8] Sync level 0</div><div>frame=   10 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.40 bitrate=N/A speed=1.37x    </div><div>video:5kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown</div><div>Input file #0 (testsrc2):</div><div>  Input stream #0:0 (video): 10 packets read (1152000 bytes); 10 frames decoded; </div><div>  Total: 10 packets (1152000 bytes) demuxed</div><div>Input file #1 (testsrc2):</div><div>  Input stream #1:0 (video): 10 packets read (1152000 bytes); 10 frames decoded; </div><div>  Total: 10 packets (1152000 bytes) demuxed</div><div>Output file #0 (pipe:):</div><div>  Output stream #0:0 (video): 10 frames encoded; 10 packets muxed (5280 bytes); </div><div>  Total: 10 packets (5280 bytes) muxed</div><div>20 frames successfully decoded, 0 decoding errors</div><div>[libvmaf @ 0x57c00c0] VMAF score: 99.738520</div></div><div><br></div></div>