ofImage from ofVideograbber looses alpha



I want to copy the frame of a movie that has alpha channel to an ofImage keeping the alpha transparency. My code looks something like this:

ofImage img;
ofVideoPlayer movie;
// ...
img.allocate(w,h, OF_IMAGE_COLOR_ALPHA);
// ...
// ...
img.draw(0,0); // has no alpha -- debugger says it's RGB, not RGBA
movie.draw(0,0); // has alpha alright and it is transparent

In the log I found these errors:

[ error ] ofImage: getBmpFromPixels(): unable to get FIBITMAP from ofPixels
[ error ] ofImage: putBmpIntoPixels(): unable to set ofPixels from FIBITMAP

Any hints on how to make it work?



Looks like a bug, I would also expect ofimage to grab the alpha correctly.
Did you try to use the other API?

setFromPixels(const PixelType * newPixels, int w, int h, ofImageType newType, bool bOrderIsRGB)


Yep, I did.


I thought videoGrabber should be something with camera while videoPlayer with movies;
Maybe you can try videoPlayer;


Sorry @AntonioFrog , you’re right. It’s actually ofVideoPlayer, not ofVideoGrabber. I misstyped it here, not in the actual program. Will fix it now