[FFmpeg-trac] #11629(ffmpeg:new): Memory Leak in FFmpeg During Extended Processing
FFmpeg
trac at avcodec.org
Wed Jun 11 00:16:30 EEST 2025
#11629: Memory Leak in FFmpeg During Extended Processing
-------------------------------------+-------------------------------------
Reporter: mg3242 | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: ffmpeg
Version: git-master | Resolution:
Keywords: | Blocked By:
leak,vaapi,24/7 transcoding |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Description changed by mg3242:
Old description:
> Summary of the bug:
> if you run this process with a live tv stream with this input over 24h it
> starts leaking memory:
> [mpegts @ 000002f95aa59c80] Could not find codec parameters for stream 6
> (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
> Consider increasing the value for the 'analyzeduration' (0) and
> 'probesize' (5000000) options
> Input #0, mpegts, from 'http://192.168.4.168/play/a01b':
> Duration: N/A, start: 71417.021867, bitrate: N/A
> Program 17201
> Metadata:
> service_name : SRF 1 HD Clear
> service_provider:
> Stream #0:1[0x65]: Video: h264 (High) ([27][0][0][0] / 0x001B),
> yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k
> tbn
> Stream #0:2[0x66](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz,
> stereo, fltp, 384 kb/s
> Stream #0:3[0x67](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz,
> stereo, fltp, 384 kb/s
> Stream #0:4[0x68](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz,
> stereo, fltp, 192 kb/s (visual impaired) (descriptions)
> Stream #0:5[0x69](deu,deu): Subtitle: dvb_teletext
> (libzvbi_teletextdec) ([6][0][0][0] / 0x0006), 492x250
> Stream #0:6[0x6a]: Unknown: none ([5][0][0][0] / 0x0005)
> No Program
> Stream #0:0[0x12]: Data: epg
> Unsupported codec with id 98306 for input stream 0
> Unsupported codec with id 0 for input stream 6
>
> i tried to run valgrind to report the leak better, but valgrind and live
> stream transcoding does not go well together. please advice how i can get
> a log which will help to identify the problem.
>
> i will also compile ffmpeg_g git-master as soon as i know how to log the
> leak.
> i tried every possible flag out there and found out that only the flag
> -sn which removes teletext and teletext subtitles is able to go on
> transcoding over the 24h mark.
>
> How to reproduce:
> {{{
> % ffmpeg -re -y -hwaccel vaapi -hwaccel_device /dev/dri/renderD128
> -hwaccel_output_format vaapi -progress pipe:2 -i srt://192.168.4.168:5001
> -map 0:v -c:v h264_vaapi -rc_mode QVBR -global_quality 14 -profile:v
> constrained_baseline -b:v 2M -maxrate 4M -bufsize 8M -map 0:a:? -q:a 0.7
> -c:a aac -ac 2 -ar 48000 -map 0:s:? -c:s copy -f mpegts
> udp://239.1.1.11:1234?pkt_size=1316
> ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
> built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
> configuration: --disable-decoder=amrnb --disable-gnutls --disable-
> liblensfun --disable-libopencv --disable-podpages --disable-sndio
> --disable-stripping --enable-avfilter --enable-chromaprint --enable-
> frei0r --enable-gcrypt --enable-gpl --enable-ladspa --enable-libaom
> --enable-libaribb24 --enable-libass --enable-libbluray --enable-libbs2b
> --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d
> --enable-libdc1394 --enable-libdrm --enable-libdvdnav --enable-libdvdread
> --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-
> libfribidi --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-
> libiec61883 --enable-libjack --enable-libjxl --enable-libmp3lame
> --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-
> libopus --enable-libplacebo --enable-libpulse --enable-librabbitmq
> --enable-librist --enable-librsvg --enable-librubberband --enable-
> libshine --enable-libsmbclient --enable-libsnappy --enable-libsoxr
> --enable-libspeex --enable-libsrt --enable-libsvtav1 --enable-
> libtesseract --enable-libtheora --enable-libtwolame --enable-libvidstab
> --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-
> libwebp --enable-libwebp --enable-libx264 --enable-libx265 --enable-
> libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-
> libzvbi --enable-lv2 --enable-nonfree --enable-openal --enable-opencl
> --enable-opengl --enable-openssl --enable-postproc --enable-pthreads
> --enable-shared --enable-version3 --incdir=/usr/include/x86_64-linux-gnu
> --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --toolchain=hardened
> --enable-vaapi --enable-libvpl --enable-libxavs2 --enable-libdavs2
> --enable-libvmaf --enable-librav1e --enable-libvvenc --enable-libilbc
> --enable-libklvanc --enable-libfdk-aac --enable-libkvazaar --enable-omx
> --cc=x86_64-linux-gnu-gcc --cxx=x86_64-linux-gnu-g++ --disable-altivec
> --shlibdir=/usr/lib/x86_64-linux-gnu
> }}}
New description:
Summary of the bug:
if you run this process with a live tv stream with this input over 24h it
starts leaking memory:
[mpegts @ 000002f95aa59c80] Could not find codec parameters for stream 6
(Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and
'probesize' (5000000) options
Input #0, mpegts, from 'http://192.168.4.168/play/a01b':
Duration: N/A, start: 71417.021867, bitrate: N/A
Program 17201
Metadata:
service_name : Clear
service_provider:
Stream #0:1[0x65]: Video: h264 (High) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Stream #0:2[0x66](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz,
stereo, fltp, 384 kb/s
Stream #0:3[0x67](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz,
stereo, fltp, 384 kb/s
Stream #0:4[0x68](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz,
stereo, fltp, 192 kb/s (visual impaired) (descriptions)
Stream #0:5[0x69](deu,deu): Subtitle: dvb_teletext (libzvbi_teletextdec)
([6][0][0][0] / 0x0006), 492x250
Stream #0:6[0x6a]: Unknown: none ([5][0][0][0] / 0x0005)
No Program
Stream #0:0[0x12]: Data: epg
Unsupported codec with id 98306 for input stream 0
Unsupported codec with id 0 for input stream 6
i tried to run valgrind to report the leak better, but valgrind and live
stream transcoding does not go well together. please advice how i can get
a log which will help to identify the problem.
i will also compile ffmpeg_g git-master as soon as i know how to log the
leak.
i tried every possible flag out there and found out that only the flag -sn
which removes teletext and teletext subtitles is able to go on transcoding
over the 24h mark.
How to reproduce:
{{{
% ffmpeg -re -y -hwaccel vaapi -hwaccel_device /dev/dri/renderD128
-hwaccel_output_format vaapi -progress pipe:2 -i srt://192.168.4.168:5001
-map 0:v -c:v h264_vaapi -rc_mode QVBR -global_quality 14 -profile:v
constrained_baseline -b:v 2M -maxrate 4M -bufsize 8M -map 0:a:? -q:a 0.7
-c:a aac -ac 2 -ar 48000 -map 0:s:? -c:s copy -f mpegts
udp://239.1.1.11:1234?pkt_size=1316
ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
configuration: --disable-decoder=amrnb --disable-gnutls --disable-
liblensfun --disable-libopencv --disable-podpages --disable-sndio
--disable-stripping --enable-avfilter --enable-chromaprint --enable-frei0r
--enable-gcrypt --enable-gpl --enable-ladspa --enable-libaom --enable-
libaribb24 --enable-libass --enable-libbluray --enable-libbs2b --enable-
libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-
libdc1394 --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-
libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libiec61883
--enable-libjack --enable-libjxl --enable-libmp3lame --enable-libmysofa
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264
--enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-
libplacebo --enable-libpulse --enable-librabbitmq --enable-librist
--enable-librsvg --enable-librubberband --enable-libshine --enable-
libsmbclient --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-
libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwebp --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid
--enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-
nonfree --enable-openal --enable-opencl --enable-opengl --enable-openssl
--enable-postproc --enable-pthreads --enable-shared --enable-version3
--incdir=/usr/include/x86_64-linux-gnu --libdir=/usr/lib/x86_64-linux-gnu
--prefix=/usr --toolchain=hardened --enable-vaapi --enable-libvpl
--enable-libxavs2 --enable-libdavs2 --enable-libvmaf --enable-librav1e
--enable-libvvenc --enable-libilbc --enable-libklvanc --enable-libfdk-aac
--enable-libkvazaar --enable-omx --cc=x86_64-linux-gnu-gcc --cxx=x86_64
-linux-gnu-g++ --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
}}}
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:7>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list