I have a developer suite of agx orin, which connects to the black and white imx565 sensor through CSI, and can capture raw data using v4l2-ctl. However, due to the requirement of the project function, hardware acceleration is required, so the nvv4l2camerasrc plug-in of gstream should be used. But it does not support gray12 format, how to customize the nvv4l2camerasrc plugin to support gray12.
I refer to the following link, after some modifications still can not crawl, the error is as follows:
Gstnvv4l2camerasrc with GRAY8 support - Jetson Xavier NX - NVIDIA Developer Forums
Macrosilicon USB - Jetson & Embedded Systems / Jetson Nano - NVIDIA Developer Forums
erro:
xxx@xxx-desktop:~$ gst-launch-1.0 nvv4l2camerasrc num-buffers=1 device=/dev/video0 ! ‘video/x-raw(memory:NVMM),format=GRAY12,width=4128,height=3008,framerate=29/1’ ! fakesink
WARNING: erroneous pipeline: could not link nvv4l2camerasrc0 to fakesink0, nvv4l2camerasrc0 can’t handle caps video/x-raw(memory:NVMM), format=(string)GRAY12, width=(int)4128, height=(int)3008, framerate=(fraction)29/1
gstnvv4l2camerasrc.cpp
/* Capture caps of plugin */
#define CAPTURE_CAPS \
"video/x-raw(memory:NVMM), " \
"width = (int) [ 1, MAX ], " \
"height = (int) [ 1, MAX ], " \
"format = (string) { GRAY12 }, " \
"interlace-mode = (string) { progressive, interlaced }, " \
"framerate = (fraction) [ 0, MAX ];"
NvBufSurfaceAllocateParams param = {{0}};
param.params.width = self->width;
param.params.height = self->height;
param.params.layout = NVBUF_LAYOUT_PITCH;
param.params.memType = NVBUF_MEM_DEFAULT;
param.params.gpuId = 0;
param.params.colorFormat = NVBUF_COLOR_FORMAT_GRAY12;
nvbufsurface.h
NVBUF_COLOR_FORMAT_BGRA_10_10_10_2_709,
/** Specifies Non-linear RGB BT.2020 colorspace - BGRA-10-10-10-2 planar. */
NVBUF_COLOR_FORMAT_BGRA_10_10_10_2_2020,
/** Specifies Optical flow SAD calculation Buffer format */
NVBUF_COLOR_FORMAT_A32,
/** Specifies BT.601 colorspace - 10 bit YUV 4:2:2 interleaved. */
NVBUF_COLOR_FORMAT_UYVP,
/** Specifies BT.601 colorspace - 10 bit YUV ER 4:2:2 interleaved. */
NVBUF_COLOR_FORMAT_UYVP_ER,
NVBUF_COLOR_FORMAT_GRAY12,
NVBUF_COLOR_FORMAT_LAST
} NvBufSurfaceColorFormat;
Please help me.