Play Video with Alpha

Hi, I wanted to ask if it is possible to play a video with alpha channel in ofx I saw there was an add-on which worked only in OSX, I wanted to ask if there is more official way to do this. I want to use this feature in windows.
I used to work with an add-on called ofxAlphaVideoPlayer a few years ago but now I can’t seem to find it anywhere.
Thanks very much
Best Regards

Hi there,

You must call ofVideoPlayer::setPixelFormat(OF_PIXELS_RGBA) before loading your video file.

If you want to work with a lot of videos, you might consider ofxHapPlayer.

1 Like

Thanks very much hubris, I tried your solutions but unfortunately it didn’t work with my “mov” videos which have alpha channels and I had black background instead of transparent background.
This is a link to the video I’m using :

You’ll need to re-encode your movies if you want to use ofxHapPlayer (and they will be bigger than h264), but it was totally worth it in my case, everything played super smoothly in high resolutions with an alpha channel and I was able to accurately set it to individual frames within the movie.

Thanks very much hahakid , I haven’t tried ofxHapPlayer I just tried ofVideoPlayer which I said didn’t work. what do you mean by re-encoding the movie?
Thanks very much

It looks like your file on won’t download since it’s over the bandwidth limit so I can’t check out your file. However, as far as I know H.264 does not support alpha, and you’ll have to use another format like Hap Alpha/HapQ with ofxHapPlayer as already suggested, or you could try Apple’s ProRes 4444 which you could use with the native ofVideoPlayer (on OS X). Once you have the codecs installed, you’ll have to export your source video from wherever it was generated (After Effects?) to the format of your choosing.

Thanks very much mattfelsen , I tried ofxHapPlayer but unfortunately got errors on building, seems an issue which hasn’t been solved :