Transparent video player

Hi,

I’m running windows OF 0.9.8. I’d like to play a transparent video file and I’ve done that in osx some time ago but now I’m stuck with windows. I’m rendering out a quicktime with PNG encoding from after effects. And I can get the video to play in OF, unfortunately the transparency comes out really strange. I have a yellow background on which I’d like to show the green streak video and what I’m seeing is just artefacts of the actual video on top of yellow. Or actually it seems that the yellow has some tears and the green is seen through it, which is weird in general since yellow is just a rectangle.

ofEnableBlendMode(OF_BLENDMODE_ALPHA);
testVideoTransparency.setPixelFormat(OF_PIXELS_RGBA);
testVideoTransparency.load("testTransparency.mov");
testVideoTransparency.setLoopState(OF_LOOP_NORMAL);
testVideoTransparency.play();

Simple draw running in the update. Nothing special.

I’ve tried running

	ofEnableBlendMode(OF_BLENDMODE_SCREEN);

and the artifacts are gone. But, I get screen blending which is not what I’m after in the end.

All help appreciated!

Thanks

Try this:

testVideoTransparency.setPixelFormat(OF_PIXELS_BGRA);

and without this line:

ofEnableBlendMode(OF_BLENDMODE_SCREEN);

this seems to have fixed it. I’m a little confused as to why swapping RGBA with BGRA would fix it, considering I was seeing the right colors with RGBA also. Isn’t it just swapping one color channel [r] with another [b].

Thanks!