[FFmpeg-devel] [PATCH v2 1/2] avfilter: add scale_d3d11 filter

Dash Santosh Sathyanarayanan dash.sathyanarayanan at multicorewareinc.com
Thu Jun 26 08:24:15 EEST 2025


On 24-06-2025 13:26, Hendrik Leppkes wrote:

+        if (frames_ctx->sw_format == AV_PIX_FMT_NV12) {
+            frames_hwctx->BindFlags |= D3D11_BIND_VIDEO_ENCODER;
+        }

The filter should be designed universally rather than expecting to be connected
to something specific at its output. Whether or not the bind_encoder bind flag
should be set, needs to be determined during negotiation of the output
connection.


The above change is in dxva2.c, when the decoder output surface is passed directly
to supported encoder, it requires BIND_VIDEO_ENCODER flag to be set. This does not
affect any intermediate steps. A surface with encoder bindflags set can be used as
input for any supported filters as well (confirmed with the scale_d3d11 filter).



This part is still not acceptable. You blindly set a flag based on
what you need, if special flags on the context are needed they should
be negotiated between the different components, guided by the users
use-case and input, and not hardcoded based on an arbitrary condition
of a pixel format.


You are right, but the bind flags will have to be set before the D3D11 texture2D surfaces are
allocated and I could not find a way to negotiate and set those either from the encoder or other
components and even as a configurable decoder option. Do you have any suggestions?

Appreciate the feedback.

Thanks,
Dash


More information about the ffmpeg-devel mailing list