Details about gstreamer RGBx format

Sebastian Dröge sebastian at centricular.com
Tue Mar 24 03:33:52 PDT 2015


On Mi, 2015-03-18 at 08:16 -0700, maxilase wrote:
> Hello Gstreamer !
> 
> I have run into some issue about getting a videostream into my application.
> I am senting an videostream via rtphpay to the server and I am getting it
> for a client via rtspsrc.
> The video stream is fine except one thing : the Red and Blue colors are
> inverted.
> 
> My application is based on Qt and is taking the video stream frame by frame
> with a QImage formatted 
> << QImage
> <http://qt-project.org/doc/qt-4.8-snapshot/qimage.html#Format-enum> 
> ::Format_RGB32 --> The image is stored using a 32-bit RGB format
> (0xffRRGGBB)>>
> (You would have noticed that it is actually an ARGB format with the Alpha
> channel set to OxFF).
> 
> My reception pipeline is like this :
> rtspsrc location=RTSPURL ! rtph26depay ! avdec_h264 ! videoconvert ! appsink
> name=sink sync=false caps="video/x-raw,format=RGBx"
> 
> Which is working with inverted Red and Green. Now the fun part is that when
> i change the format to BGRx. It work...
> So my question is "How does Gstreamer handle the RGBx format ?" is it
> inverted ?

If you read RGBx in GStreamer, that means that the first byte will be
the R component, the second the G, etc. If libraries like Qt or Cairo
say RGB they usually mean 0xffRRGGBB, which means that if you're on a
little endian architecture that the first byte will be the B component
(in GStreamer terms this would be BGRx).

In GStreamer the formats are defined by their memory order, in libraries
like Qt by terms of the most/least significant byte when storing the
pixel in an appropriately sized integer.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150324/faf15260/attachment.sig>


More information about the gstreamer-devel mailing list