Opened 11 days ago

Last modified 10 days ago

#11426 new defect

Memory leak in Intel QSV decoder

Reported by: Aleksoid1978 Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords: QSV
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Aleksoid1978)

Summary of the bug:
Memory leak on call avcodec_flush_buffers() when use h264_qsv decoder in Windows 10/11.

For ease of reproduction, I simply took the official example https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/qsv_decode.c and added a call to avcodec_flush_buffers(decoder_ctx) in the read/decode loop for every 10th packet.
For each call to avcodec_flush_buffers(), memory consumption increases.

Windows 11 24H2.
Intel UHD 730 with the latest drivers, no memory leak.
Intel HD 530 with the latest drivers, memory leak.

I agree that the Intel drivers are to blame here, but maybe something is missing in the code in ffmpeg?

Attachments (1)

qsv_decode_flush_fix.diff (2.1 KB ) - added by Aleksoid1978 10 days ago.
qsv_decode_flush_fix

Download all attachments as: .zip

Change History (3)

comment:1 by Aleksoid1978, 11 days ago

Description: modified (diff)

comment:2 by Aleksoid1978, 10 days ago

A possible solution, at least for me it works - instead of reinitializing the MFX decoder, just reset it.

by Aleksoid1978, 10 days ago

Attachment: qsv_decode_flush_fix.diff added

qsv_decode_flush_fix

Note: See TracTickets for help on using tickets.