[FFmpeg-devel] Help Needed - D3D11 Scaling Filter

Dash Santosh dash.sathyanarayanan at multicorewareinc.com
Mon Dec 30 09:18:38 EET 2024


Hi,

I'm trying to implement a scaling filter (vf_scale_d3d11) using the
VideoProcessBlt D3D11 DDI, and also add PIX_FMT_D3D11 support for the
MediaFoundation Encoder (mfenc).

Initially, there were a lot of "Static surface pool size exceeded".
```
decode_receive_frame_internal failed = Invalid data found when processing
input
Static surface pool size exceeded
get_buffer() failed
thread_get_buffer() failed
decode_slice_headec error
no frame!
```

This got fixed by incrementing initial_pool_size by 3. Now the following
two flows works as expected:
    1) ./ffmpeg.exe -hwaccel d3d11va -hwaccel_output_format d3d11
-hide_banner -i bbb_sunflower_2160p_30fps_normal.mp4 -hw_encoding 1 -c:v
h264_mf -vframes 100 -loglevel verbose sample.mp4 -y
    2) ./ffmpeg.exe -hwaccel d3d11va -hwaccel_output_format d3d11
-hide_banner -i bbb_sunflower_2160p_30fps_normal.mp4 -hw_encoding 1 -c:v
h264_mf -vf "scale_d3d11=width=1920:height=1080" -vframes 100 -loglevel
verbose sample.mp4 -y

When I try to call av_hwframe_transfer_data() within the
`if(encoder_requires_software_frame)` block for the following flow, "Static
surface pool size exceeded" occurs once again.
    3) ./ffmpeg.exe -hwaccel d3d11va -hwaccel_output_format d3d11
-hide_banner -i bbb_sunflower_2160p_30fps_normal.mp4 -c:v rawvideo -vframes
10 -loglevel verbose sample.yuv -y

Increasing the pool_size to any higher value doesn't seem to resolve this
issue. The same error can be observed when the changes are integrated in
HandBrake application, even for use cases (1) and (2). Any insights on why
this would occur and how to fix this would be appreciated. Attaching the
patch FYI.

Thanks,
Dash

-- 

* <https://multicorewareinc.com/>*
  <https://www.linkedin.com/company/multicoreware-inc/>
<https://twitter.com/MulticoreWare>
<https://www.facebook.com/multicoreware>
<https://www.youtube.com/channel/UCXZ1A1MzS5JwBqwBkNfsBBw?sub_confirmation=1>
   <https://www.instagram.com/multicoreware.inc/>

*Dash Santosh*

*Research Engineer, Video Engineering*

Mobile: +91 78679 43737

IndiQube Echo Point, Avinashi Road

Coimbatore - 641 014
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wip-d3d11-scaling-filter-mf-encoder-support.patch
Type: application/octet-stream
Size: 28553 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241230/ce28c8db/attachment.obj>


More information about the ffmpeg-devel mailing list