[FFmpeg-devel] [PATCH v2] lavfi/vf_libplacebo: add vulkan device import fallback

Dennis Mungai dmngaie at gmail.com
Thu May 11 14:57:40 EEST 2023


On Thu, 11 May 2023 at 14:21, Hendrik Leppkes <h.leppkes at gmail.com> wrote:

> On Thu, May 11, 2023 at 11:32 AM Lynne <dev at lynne.ee> wrote:
> >
> > May 11, 2023, 10:39 by ffmpeg at haasn.xyz:
> >
> > > From: Niklas Haas <git at haasn.dev>
> > >
> > > Recent versions of libplacebo have required Vulkan versions
> incompatible
> > > with lavu Vulkan hwcontexts. While this is expected to change
> > > eventually, breaking vf_libplacebo every time there is such a
> transition
> > > period is obviously undesired behavior, as the following sea of bug
> > > reports shows.
> > >
> > > This commit adds a fallback path for pl_vulkan_import failures which
> > > simply creates an internal device instead. Also useful when no interop
> > > with lavu vulkan hwframes is needed or desired.
> > >
> > > Fixes: https://github.com/haasn/libplacebo/issues/170
> > > Fixes:
> https://github.com/mpv-player/mpv/issues/9589#issuecomment-1535432185
> > > Fixes: https://code.videolan.org/videolan/libplacebo/-/issues/270
> > >
> >
> > NAK. The whole point of the hwcontext infrastructure is to be
> > explicit, and creating a new device behind the scenes is anything but
> that.
> >
> >
>
> This is not a native vulkan filter, it is an external library not
> married to our vulkan infrastructure - it merely has compatibility for
> it.
>
> Ensuring it works, as it might have separate requirements or a
> different development cycle, is hardly a bad thing. And it greatly
> simplifies the usability for users that only want a quick GPU
> processing.
>
> - Hendrik
>

And related to this: We also have multiple filters that can create random
devices on demand, a prime example being hwupload_cuda and hwmap (depending
on the derivation mode used).

Rejecting this patch on the basis of "creating devices behind the scenes"
disregards the context and purpose in which the aforementioned device is
created, such as in cases where no interop with lavu vulkan hwframes is
needed or desired. Without this patch, libplacebo will keep breaking quite
frequently with changes to the vk hwcontext code.

The maintenance burden, especially on documentation for when working
command-lines fail (and they will, without this patch) will be significant.

Something to consider, considering how fragile the Vulkan support is in
FFmpeg.

Warm regards,

Dennis.


More information about the ffmpeg-devel mailing list