Programtic access to raw video via v4l2

I am using an Lattice Crosslink FPGA to simulate an imx219 camera based on this project:

I am using a TX2 NX with JetPack 4.6.4 and due to the way that crosslink generates CRC I had to disable CRC in csi4 based on this link:

Now I can capture raw frames (sensor is RAW10) using v4l2-ctl like this:
v4l2-ctl --set-fmt-video=width=3264,height=2464,pixelformat=RG10 --stream-mmap --stream-count=100 -d /dev/video0 --stream-to=file.raw

I can’t use argus since argus doesn’t support disabling CRC:

How can I programmatically read frames that emulate the v4l2-ctl command.

Any way with gstreamer? I tried this line but it failed since it says it can open a raw stream:


nvidia@tegra-ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1' ! omxh264enc control-rate=2 bitrate=4000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay mtu=1400 ! udpsink host=10.42.0.1 port=5000 sync=false async=false
WARNING: erroneous pipeline: could not link v4l2src0 to omxh264enc-omxh264enc0, v4l2src0 can't handle caps video/x-raw(memory:NVMM), width=(int)3280, height=(int)2464, format=(string)NV12, framerate=(fraction)20/1

How you typically access raw data via v4l?

Try have FPGA output YUV422.

Thanks

Ofc that is the easy way but not sure I can easily change that, also would need to change the driver…

Any other way?

You can also modify the v4l2src to support it.

Any pointers on how to do it?

Have reference to below link.

Thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.