[Libav-user] Memory issues when using the trim filter

Tobias Rapp t.rapp at noa-archive.com
Wed Apr 10 15:02:38 EEST 2019


in my libav-based application I have the issue that memory consumption 
is rising when I use the "trim" filter and trim has reached the "end" 
position. Not sure if this is caused by wrong usage of the API on my 
side or a problem inside of libavfilter.

The issue can be reproduced when making the following changes to the 
"filtering_video" example that comes with FFmpeg:

diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c
index 105a200..484c49d 100644
--- a/doc/examples/filtering_video.c
+++ b/doc/examples/filtering_video.c
@@ -38,7 +38,7 @@
  #include <libavfilter/buffersrc.h>
  #include <libavutil/opt.h>

-const char *filter_descr = "scale=78:24,transpose=cclock";
+const char *filter_descr = "trim=end=5.0,scale=78:24";
  /* other way:
     scale=78:24 [scl]; [scl] transpose=cclock // assumes "[in]" and 
"[out]" to be input output pads respectively

When playing back an SD input file the memory usage of the example 
binary reaches ~1GiB after less than a minute. Running the command with 
valgrind doesn't show leaked memory. Does anybody have an idea what 
could be the issue?


More information about the Libav-user mailing list