[FFmpeg-devel] PATCH: Fallback to NV12 format in VAAPI drivers

Mark Thompson sw at jkqxz.net
Sun Aug 11 20:57:49 EEST 2024


On 10/08/2024 09:51, Lluís Batlle i Rossell wrote:
> On Fri, Aug 09, 2024 at 09:43:53AM +0200, Lluís Batlle i Rossell wrote:
>> On Fri, Aug 09, 2024 at 11:49:54AM +0800, Zhao Zhili wrote:
>>>> vaapi drivers often lack proper image converesions and not all
>>>> situations allow vagetimage or vaputimage with the image formats
>>>> reported by the api. nv12 seems allowed in all circumstances.
>>>>
>>>> with this change now one can use the hwaccel directly without
>>>> explicit conversions to nv12 for frame downloading to work.
>>>>
>>>> gstreamer adopted a similar approach:
>>>> https://bugzilla.gnome.org/show_bug.cgi?id=752958
>>>
>>> Isn’t it break all pixel formats with bit depth > 8?
>>> I think we already have hwcontext API to select sw_format, this isn’t a bug
>>> inside ffmpeg.
>>
>> Correct... I didn't think of the need beyond NV12.
>>
>> What if I redo the patch so I keep all formats, but I simply move NV12 to
>> the first place? That will make ffmpeg pick NV12 as default if NONE
>> specified.
> 
> I attach a different patch, so NV12 is only picked in case the dst format
> is NONE.

What are the surface formats where this actually gets used, and on what hardware and driver?

It seems probably ok if this were restricted to 4:2:0 8-bit formats (as a surprise implicit downsample which can't be told anything about the source format seems very bad), but then what is it actually covering?

Thanks,

- Mark


More information about the ffmpeg-devel mailing list