Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG: chroma key / greenscreen filter for images / video [closed]

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?

like image 325
Daniel Ruf Avatar asked Nov 28 '11 16:11

Daniel Ruf


1 Answers

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> 

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).

like image 124
jladan Avatar answered Sep 30 '22 10:09

jladan