[FFmpeg-user] Guidance on debugging a potential memory leak

Jorge Villatoro jorge at voxelai.com
Thu Sep 1 20:07:19 EEST 2022


Hi,

I believe that I've stumbled across a slow memory leak in the QSV encoder,
or possibly the underlying library I'm not really sure. I've been able to
see a slow leak (~50MB/hr in the worst case) in ffmpeg processes performing
an QSV encode where an identical configuration running a CUDA encode has
stable memory usage. The command I am using looks something like this:

ffmpeg -loglevel error -nostdin -hide_banner -progress pipe:3 -y
-rtsp_transport tcp -reorder_queue_size 1000 -max_delay 2000000
-allowed_media_types video -hwaccel qsv -c:v h264_qsv -i <rtsp_url> -vf
setpts=(PTS-STARTPTS)+RTCSTART/(TB*1000000),vpp_qsv=framerate=5:w=720:h=in_h/in_w*w
-an -enc_time_base 1:1000 -c:v hevc_qsv -g 50 -b:v 500k -maxrate 2000k -f
matroska -

I've tried running valgrind on this process for a while but I'm not really
sure how to decipher the results other than that there doesn't appear to be
an obvious leak. There are quite a few messages about uninitialized values
in (/usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so) but I think these might
be false positives.

Would anyone here have any guidance as far as where to look/who to ask on
this? Has anyone else here attempted to use hevc_qsv for a streaming use
case with long-lived processes?

--Jorge


More information about the ffmpeg-user mailing list