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.