FFMPEG:用于图像/视频的色度键/绿屏过滤器 [英] FFMPEG: chroma key / greenscreen filter for images / video
问题描述
我需要一个视频使用色度键过滤器/绿屏过滤器,并将其覆盖在另一个视频上,然后将其输出为新视频.
I need for a video to use chroma key filter / greenscreen filter and overlay it over another video and output it as new video.
是否有用于此目的的现有库,脚本,过滤器或解决方案?
Are there any existing libraries, scripts, filters or solutions for this purpose?
推荐答案
(现在)的答案是肯定的,这里有一个用于生成色度键并将其覆盖的过滤器.过滤器名称为"颜色键".该网站上有一些示例,这是命令:
The answer (now) is yes, there is a filter for generating chroma-keys and overlaying them. The filter name is "color key". There are examples on the site, here's the command:
ffmpeg -i <base-video> -i <overlay-video> -filter_complex '[1:v]colorkey=0x<color>:<similarity>:<blend>[ckout];[0:v][ckout]overlay[out]' -map '[out]' <output-file>
其中,< color>
是要匹配的十六进制rgb颜色(例如:黑色为0x000000),<相似性>
是颜色匹配的容差(例如:0.3)和< blend>
(例如:0.2)控制不透明度是开还是关.(有关更多信息,请参阅文档.)
where <color>
is the rgb color to match in hex (ex: 0x000000 for black), <similarity>
is a tolerance on the color-match (ex: 0.3), and <blend>
(ex: 0.2) controls whether the opacity is on-off or how gradual it is. (See the documentation for more).
这篇关于FFMPEG:用于图像/视频的色度键/绿屏过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!