The Gstreamer and V4L2 Formats are described in this section.
- These formats signify the memory layout of pixels. It applies at the encoder input and the decoder output side.
- The encoder needs to know the memory layout of pixel at input side for reading the raw data, so the corresponding video format needs to be specified at encoder sink pad using caps.
- For the decoder, you can specify the format to be used to write the pixel in memory by specifying the corresponding Gstreamer video format using caps at decoder source pad.
- When the format is not supported between two elements, the cap negotiation fails and Gstreamer returns an error. In that case, you can use the video convert element to perform software conversion from one format to another.
The following table shows the GStreamer and V4L2 related formats that are supported.
Pixel Format | V4L2 | GStreamer |
---|---|---|
YUV 420 8-bit | V4L2_PIX_FMT_NV12 | GST_VIDEO_FORMAT_NV12 |
YUV 420 10-bit | V4L2_PIX_FMT_XV15 | GST_VIDEO_FORMAT_NV12_10LE32 |
YUV 422 8-bit | V4L2_PIX_FMT_NV16 | GST_VIDEO_FORMAT_NV16 |
YUV 422 10-bit | V4L2_PIX_FMT_XV20 | GST_VIDEO_FORMAT_NV16_10LE32 |
Note:
- The fourcc codes are the last four characters of v4L2 pixel formats (for example, GREY/XY10…).
- Y_Only 8-bit and Y_Only 10-bit are supported only at the control software layer for the encoder and decoder.
- For more information on YUV 444 format support, refer this article.