[FFmpeg-devel] [PATCH v3 5/5] avfilter: add vf_deinterlace_videotoolbox

Philip Langdale philipl at overt.org
Fri Dec 17 05:39:45 EET 2021


On Thu, 16 Dec 2021 12:28:58 -0800
Aman Karmani <ffmpeg at tmm1.net> wrote:

> From: Aman Karmani <aman at tmm1.net>
> 
> deinterlaces CVPixelBuffers, i.e. AV_PIX_FMT_VIDEOTOOLBOX frames
> 
> currently implements YADIF, but other algorithms could easily
> be added to the same filter.
> 
> for example, an interlaced mpeg2 file can be decoded by avcodec,
> uploaded into a CVPixelBuffer, deinterlaced by metal, and then
> encoded to h264 by VideoToolbox as follows:
> 
>     ffmpeg \
>            -init_hw_device videotoolbox \
>            -i interlaced.ts \
>            -vf
> hwupload,deinterlace_videotoolbox=mode=send_field:deint=interlaced \
> -c:v h264_videotoolbox \ -b:v 2000k \
>            -c:a copy \
>            -y progressive.ts
> 
> (note that uploading AVFrame into CVPixelBuffer via hwupload
>  requires 504c60660d3194758823ddd45ceddb86e35d806f)
> 
> Signed-off-by: Aman Karmani <aman at tmm1.net>

Ignoring my lack of familiarity with the Apple specific parts, this
looks reasonable, although I have the same question that Paul had about
naming. I know that you're thinking that future metal accelerated
algorithms could go in this filter, but the precedent in the codebase
is that each algorithm is a separate filter, and so if you ever wanted
to add a second one down the line, we'd be expecting it to be separate
anyway.

--phil


More information about the ffmpeg-devel mailing list