avfilter: add vf_yadif_videotoolbox
authorAman Karmani <aman@tmm1.net>
Tue, 14 Dec 2021 01:08:50 +0000 (17:08 -0800)
committerAman Karmani <aman@tmm1.net>
Sat, 18 Dec 2021 19:57:31 +0000 (11:57 -0800)
commit4ac869ca2a1caaa888ad65ebd9a9b1914bfaf9b8
tree3a79ea12e3f833aa3cd58ae610f7227756344ec9
parentecee6af8bda475b15c9a4e9037fc406039f60efc
avfilter: add vf_yadif_videotoolbox

deinterlaces CVPixelBuffers, i.e. AV_PIX_FMT_VIDEOTOOLBOX frames

for example, an interlaced mpeg2 video 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,yadif_videotoolbox \
           -c:v h264_videotoolbox \
           -b:v 2000k \
           -c:a copy \
           -y progressive.ts

(note that uploading AVFrame into CVPixelBuffer via hwupload
 requires 504c60660d3194758823ddd45ceddb86e35d806f)

this work is sponsored by Fancy Bits LLC

Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Aman Karmani <aman@tmm1.net>
Changelog
configure
libavfilter/Makefile
libavfilter/allfilters.c
libavfilter/metal/vf_yadif_videotoolbox.metal [new file with mode: 0644]
libavfilter/vf_yadif_videotoolbox.m [new file with mode: 0644]