Xavier,Jetpack4.6,Cannot change to V4L2_PIX_FMT_YUYV format

Hi,

Now ,I use a camera with 3840x2160, YUYV 8bit output format.
I wanted to change xavier’s format to YUYV 8bit, my steps:

  1. modify dts :

             csi_pixel_bit_depth = "8";
     mode_type = "yuv";
     pixel_phase = "yuyv";
    
  2. When calling the “extract_pixel_format()” function, make sure “*format” is assigned a value of “V4L2_PIX_FMT_YUYV”, i.e “*format = V4L2_PIX_FMT_YUYV;”

  3. To ensure V4L2_PIX_FMT_YUYV format, force assignment to “MEDIA_BUS_FMT_YUYV8_2X8” in the v4l2sd_set_fmt() function, as shown in the figure below:

Result:
The image display is abnormal, as shown below:

some log:

The problem:
How do I modify the YUV format correctly so that the camera displays the normal image?
Thanks!

BR.

Change the pixel_phase to UYVY or any others to check.

Hi , ShaneCCC
Thanks for your reply!
Let me try some other formats.
I confirm that the format of the camera is YUYV422, and YUV tools is also used to check the format of the raw data after saving.

Thanks!
BR.

Hi ShaneCCC,
I tried UYVY, but the result was the same as YUYV.

I confirm that the output format of this camera is YUYV 422.

When I use 7yuv tool to open the raw data,as following pictures :
normal with YUYV422:

abnormal with

BR.

If RAW image without problem by 7yuv I think it could be the APP problem to show the frame.

Hi ShaneCCC,
Thanks for your reply!
I use command“gst-launch-1.0 v4l2src device=/dev/video4 ! videoconvert ! xvimagesink&” to show the frame, are you meaning there’s something wrong with this command?

Thanks!

BR.

Have a try below commands.

gst-launch-1.0 -v v4l2src device=/dev/video4 ! 'video/x-raw, width=3840, height=2160,  format=YUYV' ! xvimagesink sync=false

gst-launch-1.0 nvv4l2camerasrc device= /dev/video4 ! 'video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, format=YUYV' ! nvvidconv ! xvimagesink sync=false

Hi , ShaneCCC

Thanks for your reply!

I failed when I tried the above command,as following picture:

Thanks!
BR.

How about below command.

gst-launch-1.0 -v v4l2src device=/dev/video4 ! 'video/x-raw, width=3840, height=2160,  format=YUYV' ! nvvidconv ! xvimagesink sync=false

Hi ShaneCCC
Thanks very much for your reply!
The command above does not work either, as shown in the figure below:

Thanks!
BR.

Have reference to below topic to adjust the command line to try.