Opened 3 years ago

Last modified 17 months ago

#7968 new defect

av_hwdevice_ctx_init fails for AV_HWDEVICE_TYPE_VAAPI with some drivers

Reported by: Steve Browne Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


The problem occurs in vaapi_decode_find_best_format because it uses vaQuerySurfaceAttributes to find the software format. The problem is the versions of both and on Ubuntu 18.04 both fail with invalid parameter when specifying a null attribute list to get the size required. This causes the following output:

Failed to query surface attributes: 18 (invalid parameter).
Failed setup for format vaapi_vld: hwaccel initialisation returned error.

In the latest release of libva-vdpau-driver (0.74b) they no longer return with invalid parameter, but they only return 2 surface attributes and neither of them are a pixel format so it will still fail. Note that this hasn't changed in head as of this ticket either. See:

I can work up a patch when I get some time, but my proposed solution would be to ignore vaQuerySurfaceAttribute failures and if no pixel format is found from surface attributes fall back to using vaMaxNumImageFormats and vaQueryImageFormats.

Change History (1)

comment:1 by wenbin,chen, 17 months ago

hi swbrowne.

I think you should submit this issue to libva team.


Note: See TracTickets for help on using tickets.