Hi,
I’m dealing with video transparencies. I have a couple of videos in mp4 formats. The first video contains color information, the second has the alpha channel mapped on gray scale. I would like to use the second video as an alpha mask for the first.
I wrote down this piece of code, taken from the forum, but it doesn’t work to me, it display the first video with no transparencies
you shouldn’t need to draw the mask at all just the first video and you should be able to do setAlphaMask only once in setup after opening the videos. No need to do it everytime in draw
Besides I do not remember the details at the moment but a couple of years ago I experimented playing videos with embedded alpha mask on OSX (some apple prores codec may be) and they were doing fine without having to mess with two separated video files and setAlphaMask.
Massimiliano I can try to find the code if you think it could be useful.
Ok I used the ofxAVFVideoPlayer addon, it was a few of versions ago but it should work with newer ones too.
Just use it like a regular video player, try feeding it with a prores 4444 encoded video with alpha channel.
It performs quite well, by the way, the prores encoded files are very large but the player can play smoothly more than a few of them together with negligible delay. A nice tool
the video player in the core already uses AV foundation since some years ago so there shouldn’t be any need to use an external addon.
also the videoplayer initializes 1 texture at the beginning and keeps using it so there’s no need to keep setting the alpha mask every time since the texture should be the same.
Are you loading the video player with loadAsync? in that case the texture might not be loaded until the first frame arrives but otherwise it should be ready once play is called.
Hi Massimiliano. Would you mind sharing how you solved it? I am trying to achieve the same effect but haven’t succeeded yet.
Thank you in advance.
Best,
Paulo