Capture Raw image with V4L2 API

Dear all,

I would like to capture a raw image from a OV24A1B sensor with the V4L2 Api.

Indeed, the OV24A1B sensor only support 10-bit grayscale and, from what I understood, there is no way to bypass the ISP with the Argus library to get a raw data (without debayering filter) ?

I managed to get a raw picture with the v4l2-ctl command:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080, --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw

But I need to do it with the V4L2 Api to have a direct access to the buffer containing the raw data. Do you know how this could be done and what are the important steps ? For example, concerning the bypass_mode=0 ?

The sensor driver is based on the ov5693.c driver.

Thanks in advance,

I did not work on that particular issue,
but you may find how to use v4loopback to convert output of csi to form of a generic web /usb camera here: https://sites.google.com/site/jetsontricks/xavier

sudo su
cd /usr/src/linux-headers-4.9.108-tegra/kernel-4.9
make modules_prepare
mkdir v4l2loopback
git clone https://github.com/umlaeute/v4l2loopback.git v4l2loopback
cd v4l2loopback
make
make install
apt-get install v4l2loopback-dkms v4l2loopback-utils
modprobe v4l2loopback devices=1 video_nr=2 exclusive_caps=1
echo options v4l2loopback devices=1 video_nr=2 exclusive_caps=1 > /etc/modprobe.d/v4l2loopback.conf
echo v4l2loopback > /etc/modules
update-initramfs -u

and

gst-launch-1.0 -v nvarguscamerasrc ! 'video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080, framerate=30/1' ! nvvidconv ! 'video/x-raw, width=640, height=480, format=I420, framerate=30/1' ! videoconvert ! identity drop-allocation=1 ! 'video/x-raw, width=640, height=480, format=RGB, framerate=30/1' ! v4l2sink device=/dev/video2