#11629(ffmpeg:new): Memory Leak in FFmpeg During Extended Processing
#11629: Memory Leak in FFmpeg During Extended Processing -------------------------------------+------------------------------------- Reporter: mg3242 | Type: defect Status: new | Priority: critical Component: ffmpeg | Version: git- Keywords: | master leak,vaapi,24/7 transcoding | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- 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 }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11629: Memory Leak in FFmpeg During Extended Processing -------------------------------------+------------------------------------- Reporter: mg3242 | Owner: (none) Type: defect | Status: new Priority: critical | Component: ffmpeg Version: git-master | Resolution: Keywords: | Blocked By: leak,vaapi,24/7 transcoding | Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by mkver): Try ASAN instead of Valgrind. It has way better performance. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11629: Memory Leak in FFmpeg During Extended Processing -------------------------------------+------------------------------------- Reporter: mg3242 | Owner: (none) Type: defect | Status: new Priority: critical | Component: ffmpeg Version: git-master | Resolution: Keywords: | Blocked By: leak,vaapi,24/7 transcoding | Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by mg3242): i have build ffmpeg_g with asan support from git master: ffmpeg version N-119855-gb7fc195e7a Copyright (c) 2000-2025 the FFmpeg developers built with Ubuntu clang version 18.1.3 (1ubuntu1) configuration: --cc=clang --cxx=clang++ --extra- cflags='-fsanitize=address -O1 -fno-omit-frame-pointer -g' --extra- ldflags='-fsanitize=address' --disable-optimizations --enable-gpl --enable-nonfree --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libass --enable-libdrm --enable-vaapi --enable-libxcb --enable-openssl --enable- libsrt libavutil 60. 3.100 / 60. 3.100 libavcodec 62. 3.101 / 62. 3.101 libavformat 62. 0.102 / 62. 0.102 libavdevice 62. 0.100 / 62. 0.100 libavfilter 11. 0.100 / 11. 0.100 libswscale 9. 0.100 / 9. 0.100 libswresample 6. 0.100 / 6. 0.100 now started the command with this parameters: ASAN_OPTIONS=log_path=/home/user/ffmpeg_asan,detect_leaks=1 /home/user/ffmpeg_g -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.1:1234?pkt_size=1316 i have to wait over 24 hours for the leak to happen. if you see any change i need to make in the meantime, please fill free to point it out. thank you in advance. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Changes (by Marton Balint): * priority: critical => normal Comment: Note that -re should NOT be used when the input is already a realtime source. It might not fix the memory leak though. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
Try ASAN instead of Valgrind. It has way better performance. You should also be more explicit about what you mean by leaking: Does it mean that ffmpeg consumes ever more memory until it runs out of it? Or
#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 | -------------------------------------+------------------------------------- Comment (by mg3242): i cant say if it does not free the a resource, as i only see ffmpeg consume more and more memory until it runs out of it. until it runs out of ram, it performs as designed. i am using now ASAN to document the leak. for some reason it did not write it as a file with this parameters: ASAN_OPTIONS=log_path=/home/user/ffmpeg_asan,detect_leaks=1 but now i am running it in the terminal to get an output directly in the terminal. Replying to [comment:1 mkver]: that it really forgets to free a resource (the former is possible without the latter)? -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
Note that -re should NOT be used when the input is already a realtime
#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 | -------------------------------------+------------------------------------- Comment (by mg3242): running it now without -re, hopefully ill have a result in around 6-8 hours, which i can post here. Replying to [comment:3 Marton Balint]: source. It might not fix the memory leak though. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Changes (by mg3242): * Attachment "log.zip" added. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Comment (by mg3242): the memory start growing on the 26th hour with Non-monotonic DTS errors which than just kept going on and filling up memory. it seams like mkver said, that maybe it does consumes ever more memory but does not free it, as ASAN did not give an output. did i build ffmpeg wrong with asan? please have a look at my log "log.txt" as zip in the attachment and advice. as mentioned before, i do not get this if i use the flag -sn. please give me a how to, if i need to provide more information. thank you. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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
#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 | -------------------------------------+------------------------------------- Comment (by Kieran Kunhya): 26 hours is the timestamp wraparound period in MPEGTS so it's an issue with the way the wraparound is handled in the TS demux most likely. (Obviously this shouldn't also cause a memory leak) -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Comment (by mg3242): do you think this is something i can get in control with -correct_ts_overflow 1? correct_ts_overflow integer (input) Correct single timestamp overflows if set to 1. Default is 1. i am running now a process again which will show me the result in around 26 hours. thank you very much in advance for any other input you can give. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:9> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Comment (by kasper93): You could run it with memory allocation tracing, so we know exactly which allocations are growing overtime. https://github.com/koute/bytehound -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:10> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Comment (by mg3242): hi, i was able to run bytehound and get the bin, please find it here, the link is 7 days valid: https://www.transfernow.net/dl/20250612N2ZbFDti after 26 hours running the memory usage grow rapidly and it is visible in the bin. i was not able to understand what exactly is responsible for it, maybe you will see it. thank you in advance for your feedback. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:11> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Comment (by kasper93): For some reason the bytehound report is not complete, it doesn't contain any allocation stack traces, so unfortunately not much use of this report. But it confirms that the issue starts 26.5 hours after starting playback, which we already knew. Something goes catastrophically wrong when timestamps start overflowing. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:12> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Comment (by Balling): Yes, we know MPEG-TS breaks after 26.5 hours. #7876 #7449 -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:13> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Comment (by mg3242): @kasper93, can you give me the correct parameters so i can run it again and we can see more? @balling, very interesting that this is known since years. but keep in mind you can run mpegts longer than 26.5 hours if you just add the flag -sn to it, this removes services as teletext, teletext subs and dvb-subs. this way it can run for days without breaking. as i am depending on these services like teletext, subs and dvb-subs, i cant have a unreliable live stream restarting 26.5 hours after starting. anything else i can provide to have a better clue what is causes this exactly? i am very determined to help solve this. also my offer still stands, i can make the stream available to any developer which is interested to have a deeper look into this. thank you in advance! -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:14> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#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 | -------------------------------------+------------------------------------- Comment (by kasper93): Replying to [comment:14 mg3242]:
@kasper93, can you give me the correct parameters so i can run it again and we can see more?
Hard to say, I don't really know why it failed for you. LD_PRELOAD=./libbytehound.so should be enough to trace allocations. I generally also build target with `-fno-omit-frame-pointer` and statically linked, depends on what I test. You could run it for few seconds and inspect the trace to see if it works. However, probably no need to spend much effort on this, because likely the issues with mpegts are more complex than only specific allocation that is not freed. I just suggested this as an easy way to pinpoint where it comes from. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:15> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11629: MPEG-TS PCR rollover caused memory leak? --------------------------------------+------------------------------------ Reporter: mg3242 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: mpegts vaapi | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | --------------------------------------+------------------------------------ Changes (by MasterQuestionable): * cc: MasterQuestionable (added) * component: ffmpeg => avformat * keywords: leak,vaapi,24/7 transcoding => mpegts vaapi * summary: Memory Leak in FFmpeg During Extended Processing => MPEG-TS PCR rollover caused memory leak? Comment: ͏ I suspect this is strictly an input reading issue. ͏ I.e. just reading the input, without any transcoding ("-c copy"), and output to "/dev/null" (with "-f null" maybe): ͏ Could reproduce. ͏ If not, try still output with "-f mpegts". ͏ Meanwhile, try to also ascertain the minimal media stream(s) required for the reproduction. ͏ (i.e. "-map" only the minimum necessary streams) ͏ Trying removing all unnecessary options for the reproduction: ͏ So to pin-point the exact cause. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:16> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11629: MPEG-TS PCR rollover caused memory leak? --------------------------------------+------------------------------------ Reporter: mg3242 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: mpegts vaapi | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | --------------------------------------+------------------------------------ Comment (by Balling):
Meanwhile, try to also ascertain the minimal media stream(s) required for the reproduction.
And can someone finally say whether file from https://samples.ffmpeg.org /ffmpeg-bugs/trac/ticket7449/ is the same issue as this issue and #8689? -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:17> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11629: MPEG-TS PCR rollover caused memory leak? --------------------------------------+------------------------------------ Reporter: mg3242 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: mpegts vaapi | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | --------------------------------------+------------------------------------ Comment (by MasterQuestionable): ͏ Sorry, have other tasks yet. ͏ (thus unavailable for the pin-point verification by self) -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:18> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11629: MPEG-TS PCR rollover caused memory leak? --------------------------------------+------------------------------------ Reporter: mg3242 | Owner: (none) Type: defect | Status: new Priority: normal | Component: avformat Version: git-master | Resolution: Keywords: mpegts vaapi | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | --------------------------------------+------------------------------------ Comment (by Gyan): Can you test without the audio mapped? -- Ticket URL: <https://trac.ffmpeg.org/ticket/11629#comment:19> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg