About the issue of getting the YUV422 (YUYV) video frame with the camera driver in 'L4T_R32.2.1'

Dear Sir,

We use the camera driver in ‘L4T_R32.2.1’ to get the YUV422 (YUYV) video frame.
In the device tree, the mode is described as below:

mode1 {

pixel_t = “yuv_yuyv16”;

};

Use the following command to capture YUV422 (YUYV) video frames:

v4l2-ctl --device /dev/video0 --stream-mmap --stream-count=120 --stream-to=dump.yuv

Use the following command to play YUV422 (YUYV) video frames:

vlc --demux=rawvideo --rawvid-width=1280 --rawvid-height=720 --rawvid-chroma=YUYV --rawvid-fps=1 ./dump.yuv

The command could not play the video frames correctly.

But when changing “–rawvid-chroma” as “UYVY”, the command could play the video frames correctly:

vlc --demux=rawvideo --rawvid-width=1280 --rawvid-height=720 --rawvid-chroma=UYVY --rawvid-fps=1 ./dump.yuv

And then change the values of ‘enum tegra_image_format’ (nvidia/drivers/media/platform/tegra/camera/vi/vi4_formats.h)related to YUV422 :

from :
enum tegra_image_format {

TEGRA_IMAGE_FORMAT_T_Y8_U8__Y8_V8 = 200,
TEGRA_IMAGE_FORMAT_T_Y8_V8__Y8_U8,

TEGRA_IMAGE_FORMAT_T_U8_Y8__V8_Y8 = 203,

TEGRA_IMAGE_FORMAT_T_V8_Y8__U8_Y8 = 223,

};

to:

enum tegra_image_format {

TEGRA_IMAGE_FORMAT_T_U8_Y8__V8_Y8 = 200,
TEGRA_IMAGE_FORMAT_T_V8_Y8__U8_Y8,

TEGRA_IMAGE_FORMAT_T_Y8_U8__Y8_V8 = 203,
TEGRA_IMAGE_FORMAT_T_Y8_V8__Y8_U8 = 223,


};

The command could play the video frames correctly:

vlc --demux=rawvideo --rawvid-width=1280 --rawvid-height=720 --rawvid-chroma=YUYV --rawvid-fps=1 ./dump.yuv

Please help me to check the issue. Thanks!

BR,

Jeff Liao

Using v4l2-ctl to verify the driver and get the trace log to check if can get more information.

https://elinux.org/Jetson/l4t/Camera_BringUp