GStreamer with alpha / Surface channels

Hey,

sorry, I feel like spamming the new forum. I think I just like it too much here.

I already used the 2RealGstreamer block a couple of times and it worked like a charm so far. I am trying to use it with a bunch of videos with alpha channels now, but can’t get it to run. I thought since it got 4 channels the correct use would be:

unsigned char* pImg = mMovie->getVideo(); Surface( pImg, mMovie->getWidth(), mMovie->getHeight(), mMovie->getWidth() * 4, SurfaceChannelOrder::RGBA ) ;
But that gives me a memcpy exception with no stack trace at all. Leaving the rowBytes at width * 3 will compile and run, but expectedly result in a distorted image.

Any hints on this?

// Edit:
The videos themselves definetly have alpha information. I tried QT Animation and PNG, but I’m open to trying different codecs

Aye, found the problem. If someone’s interested:

_2RealGStreamerWrapper.cpp
GstCaps* caps = gst_caps_new_simple( "video/x-raw-rgb", "bpp", G_TYPE_INT, 24, "depth", G_TYPE_INT, 24, "endianness",G_TYPE_INT,4321, "red_mask",G_TYPE_INT,0xff0000, "green_mask",G_TYPE_INT,0x00ff00, "blue_mask",G_TYPE_INT,0x0000ff, "alpha_mask",G_TYPE_INT,0x000000ff, NULL );

the bytes per pixel are hard coded to 24. I’m gonna make a pull request later with my fix.

// Update

1 Like

Hi Daniel.

Just a quick question.
Is _2RealGStreamerWrapper based on gestreamer-0.10 or the 1.0 version?

Thanks,

Roger

It’s 0.10 as far as I know.

1 Like