ffmpeg transparent HEVC video from alpha matte and color video on macOS

I have an alpha.mp4 (alpha matte video) and a color.mp4 (color video). How do I use ffmpeg to make a transparent HEVC (.mov) video?

I can combine with ffmpeg to make a .webm file following the instruction here: www.unscreen.com/api under “Convert unpacked Pro Bundle to WEBM video with transparency”

From here I got

ffmpeg -y -i edited.mp4 -i matte.mp4 -f lavfi -i color=c=black:s=320x240 -filter_complex "[1:v]scale=320:240,setsar=1:1,split[vs][alpha];[0:v][vs]alphamerge[vt];[2:v][vt]overlay=shortest=1[rgb];[rgb][alpha]alphamerge" -shortest -c:v hevc_videotoolbox -allow_sw 1 -alpha_quality 0.75 -vtag hvc1 -pix_fmt yuva420p -an output.mov

which returns

Incompatible pixel format 'yuva420p' for codec 'hevc_videotoolbox', auto-selecting format 'bgra'
zsh: illegal hardware instruction ffmpeg -y -i color.mp4 -i alpha.mp4 -f lavfi -i color=c=black:s=720x1280

Running ffmpeg -h encoder=hevc_videotoolbox gives me Supported pixel formats: videotoolbox_vld nv12 yuv420p bgra p010le –

Read more here: Source link