Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Chroma or alpha on videos? #255
I've been playing around with the library to try to get some video blending going on. Specifically, I'm trying to take one layer of video (an effect, say) and layer it on top of user-shot video. After much fiddling, i was able to get things working using a chroma key blend filter.
In playing around with the video itself, though, I was interested in trying out a different way of getting an alpha channel into a video and using it with layering. I have videos that are split so that there's a separate, white alpha channel video. In other words, the alpha channel is split out into a separate video. The reason is that this way I don't have to worry about the key color in the effect video; I (supposedly) can just somehow merge the effect video with its alpha channel and get (supposedly) something I can layer over top of full video. Same idea as with a chroma key except I'm not depending on the chroma key color to tell me what's transparent. I have a separate video that can do that.
Any ideas on how a solution like this might work? Would it require a custom filter? I've tried removing a color on the alpha (pure black and white) video and then doing an alpha blend on the other, and then trying to blend that with the user video, but without much luck. Thoughts?
(and thanks so much for a great library)
You should be able to do this, but it will require a custom filter. I'd build off of one of the existing blends, and have it pull in the color components from the first image, then use the red channel from the second (alpha) image as the alpha channel for the output pixel. That should be pretty trivial to create. You can then use this movie with its custom alpha channel with something like an alpha blend to overlay it on your background scene.