Gray packed 12 bits formats

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Gray packed 12 bits formats

Detlev Casanova
Hello all !

I am currently working on a video plug-in that will do some operations on the pixels of each frame of a raw video stream.

The camera I will be using generates a gray image where each pixels are 12 bits and are packed (2 pixels on 3 bytes).

This illustrates 16 pixels values on 24 bytes:

0                8                16               24 (byte count)

​I also have the possibility to have the gray pixels of 12 bits padded with 4 bits so that they are aligned and stored in 16 bits values.

Unfortunately, I cannot find a video format that supports either of these encodings.
For the 12 bits pixels in 16 bits values, I can't use GRAY16 because it expects values in the range [0 - 0xFFFF] but the source images will be in the range [0 - 0xFFF] (a white image would actually be dark on a video viewer)

I wanted to configure my v4l2 driver with V4L2_PIX_FMT_Y12 ​but the v4l2src plug-in doesn't support it [1].

My questions are:
 * Are there plans to support such a format in plugins-good ?
 * What solution would you recommend to work with this format ?

Thanks you,


gstreamer-devel mailing list
[hidden email]