[FFmpeg-trac] #10550(avfilter:new): complex_filtergraph (trim, concat) memory leak
FFmpeg
trac at avcodec.org
Wed Sep 6 01:01:25 EEST 2023
#10550: complex_filtergraph (trim, concat) memory leak
-------------------------------------+-------------------------------------
Reporter: Kurt | Type: defect
Status: new | Priority: normal
Component: avfilter | Version: git-
Keywords: | master
filter_complex trim memleak | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
ffmpeg runs out of memory quickly when fed a complex_filtergraph with
several trim and concat commands.
More precisely:
* The filtergraph looks like: [0:video]trim=start=st1:end=en1,setpts=PTS-
STARTPTS[v1];[0:video]trim=start=st2:end=en2,setpts=PTS=STARTPTS[v2];[v1][v2]concat[vout]
to create a video from several pieces.
ffmpeg runs fine before st1 and still until en1. After en1, it starts
leaking memory at an amazing rate until it runs OOM.
How to reproduce:
{{{
% ffmpeg -i input.ts -filter_complex "[0:2]trim=start=200:end=220,setpts
=PTS-STARTPTS[v1];[0:2]trim=start=400:end=440,setpts=PTS-
STARTPTS[v2];[v1][v2]concat[v3];[0:2]trim=start=1440:end=1500,setpts=PTS-
STARTPTS[v4];[v3][v4]concat[vout]" -map [vout] -c:v libx264 output.mkv
}}}
ffmpeg version N-111899-g4489615e8f Copyright (c) 2000-2023 the FFmpeg
developers
built with gcc 12.3.1 (GCC) 20230702
configuration: --enable-gpl --enable-gnutls --enable-libass --enable-
libbluray --enable-libcdio --enable-libdav1d --enable-libopus --enable-
libpulse --enable-libmp3lame --enable-librav1e --enable-librtmp --enable-
libspeex --enable-libtwolame --enable-libvmaf --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-libx265 --enable-opengl --enable-libdrm
--enable-libsvtav1 --enable-libzvbi --enable-libfontconfig --enable-
libfreetype --enable-libfribidi --enable-shared --libdir=/usr/local/lib64
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10550>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list