Alternative to chromakey fast

Mon Jun 21, 2021 1:26 pm

Hi,

I've been searching MMV's forums, found a bunch of GLSL shaders (chromakey.txt and chromakey2.txt) as alternative but the result isn't perfect. Is there a simple solution in MMV that will match the "chromakey" features in OBS?

At the moment, i need to chromakey in OBS, add a solid perfect green and Spout it to MMV. Then in MMV, use chromakeyfast, do my visual transformation, and Spout out it back to OBS. Until i can chromakey directly my webcam in MMV, I'll have to continue this technique... but this is CPU hungry.

I've found some interesting thing on MMV GLSL shaders: viewtopic.php?f=3&t=220&p=749&hilit=chroma+key#p749
Lumakey for sky :https://magicmusicvisuals.com/forums/viewtopic.php?f=2&t=1985&p=9042&hilit=chroma+key#p9042

Any other leads to fix my issue?

Thanks!

Frank
frank_halfwong
 
Posts: 31
Joined: Wed Apr 21, 2021 5:22 pm

Re: Alternative to chromakey fast

Tue Jun 22, 2021 2:08 pm

Did you try the Chroma Mask module I recommended before?
Eric
Site Admin
 
Posts: 3201
Joined: Wed Apr 09, 2014 9:28 pm

Re: Alternative to chromakey fast

Tue Jun 22, 2021 2:40 pm

Yes, but I couldn't then restack the original area with over the masked portion. The module did an amazing job at isolating my "body" but then that's just a black mask. You talking about the chromakey.txt GLSL?

Frank
frank_halfwong
 
Posts: 31
Joined: Wed Apr 21, 2021 5:22 pm

Re: Alternative to chromakey fast

Tue Jun 22, 2021 6:50 pm

Add > ISF > Masking > Chroma Mask
Eric
Site Admin
 
Posts: 3201
Joined: Wed Apr 09, 2014 9:28 pm

Re: Alternative to chromakey fast

Tue Jun 22, 2021 8:57 pm

Perhaps just "finger trouble", but I could find no combinations of settings of the Chroma Mask module that would work in the conventional manner of a chroma key. The best I could achieve was to replace the keyed colour with opaque black rather than transparent black. I think this is the issue found by the OP.

Unlikely though it seems, I believe there's a bug in the coding (EDIT: or an omission of an obvious option to allow alpha keying as well as removal of colour) . The option "Show Alpha" displays the internal float totalAlpha, so the module appears to be keying correctly. However, the "Apply Alpha" option is coded to always apply 1.0 as alpha rather than totalAlpha so the output is never transparent.

Attached is a quick hack that fixes the above, plus it substitutes HSL for RGB to facilitate selection of the chromakey hue. I've also tweaked default values of "Apply Alpha", "Hard Cutoff", "Dilate" and "Blur".

It now works for me, although I'm certain it can be improved.
Attachments
Chroma Mask TP.fs
(11.3 KiB) Downloaded 69 times
Terry Payman
 
Posts: 642
Joined: Sun Sep 14, 2014 8:15 am
Location: UK

Re: Alternative to chromakey fast

Wed Jun 23, 2021 1:52 pm

Thanks to both of you. I'll try the two methods. @Terry, once again thanks for your custom modules.... wow. I'll let you know how the result is.

1000x thanks

Frank
frank_halfwong
 
Posts: 31
Joined: Wed Apr 21, 2021 5:22 pm

Re: Alternative to chromakey fast

Tue Jun 29, 2021 1:55 pm

Ok Terry, your custom module works GREAT!

Here's my setup for others if they want to give it a try.

Thanks again, I don't have to do the OBS to MMV to OBS setup anymore!

Frank
Attachments
ScreenHunter_240 Jun. 29 09.54.jpg
ScreenHunter_240 Jun. 29 09.54.jpg (38.53 KiB) Viewed 831 times
frank_halfwong
 
Posts: 31
Joined: Wed Apr 21, 2021 5:22 pm

Re: Alternative to chromakey fast

Tue Jun 29, 2021 1:58 pm

Cool! :D
Many thanks for the update Frank!
Terry Payman
 
Posts: 642
Joined: Sun Sep 14, 2014 8:15 am
Location: UK

Return to General Discussion

© 2021 Color & Music, LLC • This web site is mobile-friendly