[FFmpeg-trac] #7943(undetermined:new): Ffmpeg QSV backend uses >2x more GPU memory compared to VAAPI or MSDK

FFmpeg trac at avcodec.org
Fri Oct 18 11:02:57 EEST 2019


#7943: Ffmpeg QSV backend uses >2x more GPU memory compared to VAAPI or MSDK
-------------------------------------+-------------------------------------
             Reporter:  eero-t       |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  git-master   |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by fulinjie):

 Another input:
 FFmpeg qsv sets initial_pool_size to a larger value (64) compared to
 vaapi(29):

 https://github.com/FFmpeg/FFmpeg/blob/feaec3bc3133ff143b8445c919f2c4c56048fdf9/fftools/ffmpeg_qsv.c#L96
 which make sure there is enough memory in the pool for allocation.

 hwframe_pool_prealloc
 https://github.com/FFmpeg/FFmpeg/blob/feaec3bc3133ff143b8445c919f2c4c56048fdf9/libavutil/hwcontext.c#L301

 If you set the initial_pool_size to a relatively small value, for example:
 {{{
 frames_ctx->initial_pool_size = 22 + s->extra_hw_frames;
 }}}


 Similar GPU memory occupation could be obeserved:

 ffmpeg: 321 objects, 1179193344 bytes
 1.1GB

 However, a small initial_pool_size may lead to some unexpected errors
 like:

 {{{
 [hevc_qsv @ 0x55febd948300] get_buffer() failed
 Error while decoding stream #0:0: Cannot allocate memory
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7943#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list