How to use v4l2cuda sample on Jetson?

Hi,NVIDIA
I have tried to use v4l2cuda to get more formats of image according to your advise.However,it always mentioned “select timeout” even if we use the sample with no param.
How can I deal with this problem?

Thanks&BRs.

Hi,NVIDIA
I checked the dmesg log and it shown:
[三 10月 13 21:42:54 2021] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[三 10月 13 21:42:54 2021] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 128, err_data 131072
[三 10月 13 21:42:56 2021] tegra194-vi5 15c10000.vi: no reply from camera processor
[三 10月 13 21:42:56 2021] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[三 10月 13 21:42:56 2021] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[三 10月 13 21:42:56 2021] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel

Did you check with v4l2-ctl working well?

Hi,Shane
I have checked the preview with v4l2-ctl and it could work well.

Did you use camera_v4l2_cuda sample APP?
What’s command line failed and what’s successfully?

Yes,I tried to use camera_v4l2_cuda sample with command
“sudo ./camera_v4l2_cuda -d /dev/video0 -s 640x480 -f YUYV -n 30 -c”.
The preview is green and the terminal mentioned “The desired format is not supported” and “App run was successful”.

Did you try different resolution? What’s the v4l2-ctl --list-formats-ext?

Here is the format dumps.

ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘RG10’
Name : 10-bit Bayer RGRG/GBGB
Size: Discrete 3264x2464
Interval: Discrete 0.048s (21.000 fps)
Size: Discrete 3264x1848
Interval: Discrete 0.036s (28.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1640x1232
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)

I tried with 3262x2464 and it didn’t mention “The desired format is not supported” any more however the preview is still green.

This sample code only support YUV sensor but your device is Bayer sensor.

Is there any sample could get RGB images with Bayer sensor?

Hi,
There is no existing CUDA code for debayering RAW to RGB. Would need other user to share experiece/guidance so that you can do the implementation.

@932315769
You can reference to argus API and cuda sample code to implement it.

I found that I could get YUV image from argus/apps/camera/ui/camera/argus_camera sample,and could I use CUDA or any other sample to transform YUV image to RGB?

Yes, argus output YUV format.

Hi,
For converting YUV420/NV12 to RGB, you may refer to CUDA code in
jetson-video/cudaYUV-NV12.cu at master · dusty-nv/jetson-video · GitHub

Thank you very much.
I will check with the code.