<p>You could apply the colorkey to the input twice then blend the alpha channels</p>
<pre><code>-filter_complex &quot;[1:v]colorkey=0x32AB57:0.25[ck1];[1:v]colorkey=0x016733:0.2[ck2];[ck1][ck2]blend=c3_mode=and&quot;
</code></pre>

CC BY-SA 4.0
2022-04-05T15:26:17.183Z
2022-04-05T15:26:17.183Z
Anonymous
<p>I have a video with green screen. Unfortunately there is a shadow on the green screen. Increasing the tolerance got side effects. Thus I thought of the obvious, just apply colorkey twice.</p>
<p>I tried this, but it only applies the last colorkey. If I switch the two colorkeys then it either removes the shadowed area or the light area.</p>
<code>
ffmpeg -i bacground.jpg -i green.mp4 -filter_complex '[1:v]colorkey=0x32AB57:0.25:[ckout1];[ckout1]colorkey=0x016733:0.2:[ckout];[0:v][ckout]overlay[out]' -map '[out]' -map '1:a:?' -y output.mp4
</code>
<p>What Am I doing wrong here?</p>

<ffmpeg><greenscreen>
Applying colorkey twice in FFMpeg
Kjeld Flarup
# Applying colorkey twice in FFMpeg

(Asked by: username_0 on 2021-10-09)

I have a video with green screen. Unfortunately there is a shadow on the green screen. Increasing the tolerance got side effects. Thus I thought of the obvious, just apply colorkey twice.

I tried this, but it only applies the last colorkey. If I switch the two colorkeys then it either removes the shadowed area or the light area.

`ffmpeg -i bacground.jpg -i green.mp4 -filter_complex '[1:v]colorkey=0x32AB57:0.25:[ckout1];[ckout1]colorkey=0x016733:0.2:[ckout];[0:v][ckout]overlay[out]' -map '[out]' -map '1:a:?' -y output.mp4`

What Am I doing wrong here?

**Tags:** ffmpeg, greenscreen


---

## 1 answers

### Answer by username_1 on 2022-04-05. Score: 2

You could apply the colorkey to the input twice then blend the alpha channels
-filter_complex "[1:v]colorkey=0x32AB57:0.25[ck1];[1:v]colorkey=0x016733:0.2[ck2];[ck1][ck2]blend=c3_mode=and"


---

