Opened 3 years ago

Closed 3 years ago

#8021 closed defect (needs_more_info)

memory leak when using ffmpeg h264_qsv

Reported by: evenstar Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords: qsv leak
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Recently, I am working with h264 encoder API, found one thing that when i use nvenc and x264 encoder, no problem; while if i switch encoder to intel_qsv, and under some special resolution like 1280 x 704, get the memory leak like blow image:
I looked into the function submit_frame in qsvenc.c file and found out that when frame's width and height are multiples of 32, the code will run the else branch in line 1242. The code here av_frame_ref(qf->frame, frame) will increase reference counter for qf, but i can not found decrease counter anywhere. So is it the reason that lead the memory leak? I changed my input frame' w and h to other size than satisfy multiples of 32, also get memory leak.
Please have a check and help me, thank you.
Appreciate your help.

windows 10

Change History (4)

comment:1 by evenstar, 3 years ago

Component: undeterminedavcodec

comment:2 by Carl Eugen Hoyos, 3 years ago

Keywords: leak added
Version: 4.1unspecified

Please confirm that the issue is reproducible with current FFmpeg git head, the only version supported here.
If the issue is not reproducible with ffmpeg, the command line utility, please provide source code that can be compiled and allows to reproduce.

comment:3 by Sun, Xinpeng, 3 years ago

I have tested on the newest code with Ubuntu 18.04 and there is no memory leak with QSV h264 encoder under special resolutions like 1280x704. Please double confirm with current FFmpeg git head under your own environment.

comment:4 by Carl Eugen Hoyos, 3 years ago

Keywords: qsv added
Priority: importantnormal
Resolution: needs_more_info
Status: newclosed
Note: See TracTickets for help on using tickets.