利用 ffmpeg 的 maskedmerge 滤镜, 从视频中提取移动对象
ffmpeg \ -i background.png \ -i video.mkv \ -filter_complex \ " color=#00ff00:size=1280x720 [matte]; [1:0] format=rgb24, split[mask][video]; [0:0][mask] blend=all_mode=difference, curves=m='0/0 .1/0 .2/1 1/1', format=gray, smartblur=1, eq=brightness=30:contrast=3, eq=brightness=50:contrast=2, eq=brightness=-10:contrast=50, smartblur=3, format=rgb24 [mask]; [matte][video][mask] maskedmerge,format=rgb24 " \ -shortest \ -pix_fmt yuv422p \ result.mkv