Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-05T15:26:17.183Z
Answers.LastActivityDate: 2022-04-05T15:26:17.183Z
Answers.UserDisplayName: Anonymous
Body: <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>
  
Tags: <ffmpeg><greenscreen>
Title: Applying colorkey twice in FFMpeg
UserDisplayName: Kjeld Flarup
ThreadText: # 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"
  
  ```
  
  
  ---
  
  