Opened 5 years ago

Last modified 5 years ago

#643 open enhancement

VAAPI dynamic loading

Reported by: gajul Owned by:
Priority: wish Component: avcodec
Version: unspecified Keywords: VAAPI
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hi,

We have implemented VAAPI support in our video player and things are great so far. However, ffmpeg creates a hard dependency on libva when we compile it with --enable-vaapi. This means the library won't load if libva is not available. This was a big problem to us. We can't really force its installation on already deployed systems especially when they don't even support hardware acceleration. Instead, I created a patch to support VAAPI dynamic loading. This patch does not come without compromises. For example, the vaapi_context now requires additional function pointers. Still, if you think this could be useful, here is the patch.

Thanks,
Gabi Julien

Attachments (1)

10-vaapi_dynamic_load.patch (7.5 KB) - added by gajul 5 years ago.
VAAPI dynamic loading patch

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by gajul

VAAPI dynamic loading patch

comment:1 follow-up: Changed 5 years ago by cehoyos

Please correct me if I am wrong:
If your patch gets applied, existing users of FFmpeg's VAAPI implementation (vlc) have to change their code to fill the new structures?

comment:2 in reply to: ↑ 1 Changed 5 years ago by gajul

Replying to cehoyos:

Please correct me if I am wrong:
If your patch gets applied, existing users of FFmpeg's VAAPI implementation (vlc) have to change their code to fill the new structures?

That is correct. Instead of having ffmpeg lookup for the library and load it dynamically, I gave that responsibility to the caller. The reason I did this is that multiple versions if libva could be installed, in /usr/lib/ and /usr/local/lib for example, and I want to avoid conflicts. Since the caller already has to dynamically load VAAPI, it might has well provide the function pointers to ffmpeg too. I understand that this idea might not be popular because of what you mentioned and rejecting it might be best. My goal was more to share what I did in case somebody find it useful.

comment:3 Changed 5 years ago by cehoyos

  • Status changed from new to open
  1. Thank you for sharing, I absolutely agree this is a good idea!
  1. I don't find the idea unpopular, it just needs a major version bump imo, and that is rare in FFmpeg (< once a year). Otoh, it could be considered a good idea if vaapi code can be compiled without having to worry if the library is available or not. VDPAU code does not require the library either.
Note: See TracTickets for help on using tickets.