How to find the description of a color format and check its support

Revision as of 17:23, 16 September 2024 by Registered User
Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP25x lines


Depending on the software component, a color format name and definition may slightly differ. The table below references the main information relating to the different color formats.

Software frameworks Include links & Examples Support checks
Linux® kernel

DRM KMS framework

include/uapi/drm/drm_fourcc.h
DRM_FORMAT_ARGB8888 - AR24
DRM_FORMAT_NV12 - NV12

modetest
Linux® kernel

V4L2 camera or V4L2 video
frameworks

include/uapi/linux/videodev2.h
V4L2_PIX_FMT_ARGB32 - "BA24"
V4L2_PIX_FMT_NV12 - "NV12"
include/uapi/linux/media-bus-format.h
MEDIA_BUS_FMT_ARGB8888_1X32 - ?
MEDIA_BUS_FMT_UYVY12_2X12 - ?

Command examples for cameras:

v4l2-ctl -d /dev/video3 -D
media-ctl -d platform:dcmipp -p

Command examples for V4L2 video codecs:

v4l2-ctl --list-formats-out-ext
v4l2-ctl -d /dev/video0 --list-formats-ext
GStreamer framework

video-format.html and
mediatype-video-raw.html
GST_VIDEO_FORMAT_BGRA - "BGRA"
GST_VIDEO_FORMAT_NV12 - "NV12"

gst-inspect-1.0 waylandsink
gst-inspect-1.0 --no-colors v4l2jpegenc

1. Extra information[edit source]

1.1. YUV packed, full planar and semi-planar[edit source]

The "YUV" color format (also named YCbCr) memory buffers can be organized in 3 ways:

  • packed (or co-planar) with 1 buffer: for instance "YUY2" for some camera outputs
  • semi-planar with 2 buffers: for instance "NV12" for some video hardware decoders
  • full-planar with 3 buffers: for instance "I420" and "YV12" for some software video decoders

1.2. Colorimetry[edit source]

In some particular use case, it may be important to consider:

  • ITU-R BT.601 (SDTV analog) Vs. BT.709 (HDTV digital) ​
  • Limited (16-235, for video) Vs. full range (for JPEG)

1.3. RAW Bayer color formats[edit source]

1.4. Related topics[edit source]