1

I want to remove greenscreen background and am not completely satisfied with what I have achieved because I still have green borders (especially on semi-transparent areas like hair, when I move my head).

The documentation for the blend-parameter of chromakey filter says

blend

Blend percentage.

0.0 makes pixels either fully transparent, or not transparent at all.

Higher values result in semi-transparent pixels, with a higher transparency the more similar the pixels color is to the key color.

So I reckoned, I could use this to minimise greenscreen bleeding (is this the term?) when removing the background with a command like this:

ffmpeg -i DSCN0015.MOV -vf "[in] hqdn3d=4:4:8:8 [dn]; [dn] scale=iw*3:-1 [sc]; [sc] chromakey=0x005d0b:0.125:0.0 [out]" -r 24 -an -c:v ffvhuff 4.mov

But when I use anything else than 0.0 for blend, it seems to determine some kind of MINIMUM transparency and the entire frame is affected.

Here are some pics to visualize: the first is the raw material from the camera. the 2nd shows what I get with blend=0.0 and the last one shows the problem: blend=0.5, but the whole frame is almost completely transparent.

[Raw material as from camera]

[blend=0.0]

[blend=0.5]

Mat
  • 140
  • 1
  • 4
  • 12
  • 1
    The chromakey filter is not really a professional grade filter so I would not expect good outcomes for tricky areas like hair or spill. That said, if you're going to use a non-zero blend value, drop the similarity value. It is counter-intuitive but what software considers similar (mathematically) does not correlate well to human perception. The free version of [Fusion](https://www.blackmagicdesign.com/products/fusion/vfx) has multiple keyers.. Try with them. – Gyan Apr 28 '17 at 10:05
  • 1
    Thanks, Mulvya. I had it down to 0.01 (0.0 yields an error), but the effect was similar (although not as pronounced). I think, I'll give fusion a try. Cheers – Mat Apr 28 '17 at 10:28
  • Fusion looks impressive! – However, I didn't even succeed to load a clip (no joke). My copy simply does not behave as shown in the tutorial. Thank you all the same! – Mat May 05 '17 at 05:37

1 Answers1

1

The solution ultimately was to drop the similarity value as indicated by Mulvya and use very low values in the blend parameter. 0.06 for both worked fine for the lighting situation in my clips.

Mat
  • 140
  • 1
  • 4
  • 12
  • Sorry, cilap, not any more.   I'm doing greenscreen removal in OpenShot video editor, now, with satisfying results, if that helps. This does of course NOT mean, ck wouldn't work properly in ffmpeg, only that I was incapable of using it.   However, the most improvement was achieved by tightening the greenscreen to avoid all wrinkles and illuminating it as evenly as possible. Also, I use two ck-Filters: One to remove the screen as such and a 2nd one to remove the remainder at the hair. This works well for me. – Mat Apr 28 '21 at 07:42