Display bayer CSI camera output without ISP

I’d be interested in a similar example. In my case, how to capture a raw Bayer 12-bit RGGB data from an IMX264, debayer using the NPP (or other means), and continue processing in CUDA (no rendering required).

Both the argus and nvcamerasrc ISPs have poor debayering results at low exposure levels. We can achieve much better results debayering manually.

Currently, capturing raw bayer images through v4l2-ctl works fine and the image can be debayerd to greyscale in a separate process:

v4l2-ctl --device /dev/video0 --set-fmt-video=width=2464,height=2066,pixelformat=RG12 --stream-mmap --stream-to=output1.raw --stream-count=1 --stream-skip=1

Is using the v4l2cuda and camera_v4l2_cuda the best starting point? One uses V4L2_MEMORY_MMAP the other V4L2_MEMORY_DMABUF. Is there a notable difference?