I’m new to OF. I’m currently working on an iPad application where i would like to play videos containing an alpha channel. I understood there’s no compatible codec to directly do it, so i’d like to play two H.264 videos, one containing RGB channels and another containing alpha channel, and use the second one as a transparency mask of the first one.
I searched for hours on the forum but i didn’t find any good solution : the only one i found is using ofVideoPlayer::getPixels() but it’s too heavy and the iPad becomes too slow (works with images but not with videos).
I guess i have to use blending modes of OpenGL, but how ? I’m also new to OpenGL
Yes i saw this topic but as an OpenGL beginner i tested a lot of parameters in glBlendFunc() and i still don’t get it. I guess in the draw() function i need to first display the video with real RGB, so it becomes the ‘destination’ of glBlendFunc(). Then, i call glEnable(GL_BLEND) and display the video containing only the alpha channel (which is contained in R, G and B channels, so it’s white where it’s visible and black where it’s transparent).
So i have two questions : am i right ? And which parameters should i use in glBlendFunc() ?
Oh probably, sorry. I am yet to switch to ES. I know they took a lot of stuff out (like QUADS etc).
Have you tried using a shader? I’m pretty sure recent iOS devices support them (with ES2.0), it might make the processing a bit more responsive. I saw this https://github.com/BradLarson/GPUImage which wont do exactly what you need but might help as a start