From 20cf8befd5f92b911ab8d3a06ad8a23cfaa4d003 Mon Sep 17 00:00:00 2001 From: stevxiao Date: Tue, 3 Mar 2026 11:38:50 -0500 Subject: [PATCH] doc/filters: add entry for deinterlace_d3d12 Add documentation for the filter "deinterlace_d3d12" to the filters documentation. This is the follow-up for commit https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22386/commits Signed-off-by: younengxiao --- doc/filters.texi | 99 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index e49dd9ef0d..5d222c6b96 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -11652,6 +11652,105 @@ Median Do not actually modify frame. Useful when one only wants metadata. @end table +@section deinterlace_d3d12 + +Deinterlace the input video using D3D12 hardware-accelerated video processing. + +This filter uses the DirectX 12 Video Processor to perform deinterlacing on +GPU, supporting both simple bob and driver-defined advanced (motion-adaptive) +algorithms. It requires the input to be in @code{d3d12} hardware pixel format. + +The filter automatically queries the hardware for the required number of +temporal reference frames (if needed) and manages a frame queue to supply them. + +It accepts the following options: + +@table @option + +@item method +The deinterlacing method. It accepts one of the following values: + +@table @samp +@item default +Select the best deinterlacing method available on the hardware. +If the driver supports @code{custom}, that method is used; otherwise +falls back to @code{bob}. This is the default. + +@item bob +Bob deinterlacing. Each field is independently scaled to full +frame height. Simple and fast, but may produce visible bob artifacts +on moving content. + +@item custom +Driver-defined advanced deinterlacing. The exact algorithm is +hardware-specific and typically employs motion-adaptive techniques +with temporal reference frames for higher quality. +@end table + +The default value is @code{default}. + +@item mode +Specify the interlacing mode. It accepts one of the following values: + +@table @samp +@item frame +Send one frame for each frame. The output frame rate equals the input +frame rate. This is the default. + +@item field +Send one frame for each field. The output frame rate is double the +input frame rate. +@end table + +The default value is @code{frame}. + +@item deint +Specify which frames to deinterlace. It accepts one of the following values: + +@table @samp +@item all +Deinterlace all frames. This is the default. + +@item interlaced +Only deinterlace frames marked as interlaced; progressive frames are +passed through unchanged. +@end table + +The default value is @code{all}. +@end table + +@subsection Examples + +@itemize + +@item +Deinterlace an interlaced video using software decoding and the best +available hardware deinterlacing method: +@example +ffmpeg -init_hw_device d3d12va=d3d12 -filter_hw_device d3d12 -i input.ts \ + -vf "format=nv12,hwupload,deinterlace_d3d12=method=default,hwdownload,format=nv12" \ + -c:v libx264 -crf 18 output.mp4 +@end example + +@item +Deinterlace at field rate (double the frame rate) using bob method with +hardware decoding (full d3d12 pipeline): +@example +ffmpeg -hwaccel d3d12va -hwaccel_output_format d3d12 -i input.ts \ + -vf "deinterlace_d3d12=method=bob:mode=field" \ + -c:v h264_d3d12va output.mp4 +@end example + +@item +Deinterlace only interlaced frames, passing progressive frames through: +@example +ffmpeg -init_hw_device d3d12va=d3d12 -filter_hw_device d3d12 -i input.ts \ + -vf "format=nv12,hwupload,deinterlace_d3d12=deint=interlaced,hwdownload,format=nv12" \ + -c:v libx264 -crf 18 output.mp4 +@end example + +@end itemize + @section dejudder Remove judder produced by partially interlaced telecined content.