How can I chroma key a live video AND mask the video

Hello!

For a live performance I need to chroma key the Video Input from a camera and merge it with another background video from a file.
I’m pretty new to vvvv and I’m encountering some problems which I cannot solve myself.

I tried some different approaches but none of them seems to work to my satisfaction. I tried to use the node ColorKey and it works fine as long as the keyed footage comes from a file (Filestream). However, when I try to input the VideoIn, the keying does not work.
What am I doing wrong? Why is “ColorKey” not working with VideoIn? (My camera is working and I can display the camera content via “Quad”->“Renderer”)

The second problem I am encountering is the masking: I only need a small rectangle of the filmed footage to be processed. The filmed green screen does not fill out the whole the view field of the camera so I want to cut out a rectangle and only key this area. The area around the green screen shall be cut off (alpha)
Then I want to merge this keyed rectangle of the footage on to a background image with “Group”.
So far my approach to the masking is this:
Quad -> Renderer -> DX9 Texture -> Blend with VideoIn

Could you please help me with the live video chroma keying and masking?

Thanks in advance.

Edit: I attached the patch with my progress so far. Just edit the two Filestream nodes to show two different images from your hdd… The filestream on the top left is supposed to be the VideoIn later. It gets masked and then merged with another background image or video.
Why is the border of the mask so bad and jagged?

colorkey-and-mask-test.v4p (10.8 kB)

you might need something called format ex9 texture in between videoin and chromakey. anyways can suggest u moving to dx11 witch gonna make ur life much easier, not sure if there is crop effect, but u can connect transform 2d to texture transform of ur quad and tweak it manually.

Hello monogon,

I would try to use the ChangeFormat (EX9.Texture) with its Format set to ‘A8R8G8B8’ before feeding the video into the ColorKey (EX9.Texture Filter) just to be sure that there IS an alpha channel.

And I would suggest to use the SetAlpha (EX9.Texture Join) with its Composite With Original turned on after the ColorKey and instead of Blend (EX9.Texture Mixer).

The ColorKey works on the alpha channel (if there is one). The SetAlpha works on the alpha channel as well and if the Composite With Original is turned off the existing alpha channel will be simply rewritten.

Please have a look at the patch below.

Let me know if it works for you.

Best,
Anton

colorkey-and-mask-test_am.v4p (22.8 kB)

Thank you very much for your explanations and the perfectly working patch, Anton!!
This is exactly what I needed. :) I cannot thank you enough for your help! But where can I look stuff like this up in the future? Because none of the nodes you used have an explanation or tutorial patch with them.
Edit: I just found your video effects and compositing workshop. Definitely will work through it. <3

Cool!

Yes this TextureFX workshop covers some texture juggling.