I am using multimedia application for camera streaming .Camera format is as follows
Width/Height : 1456/1088
Pixel Format : 'Y10 ’
Field : None
Bytes per Line : 1472
I am capturing raw data using v4l2. Raw data will be converted to NV12 and will be copied to Nvbuffer . NvVideoEncoder encodes the data to h264 format. NV12 conversion is working properly.But encoded data is not proper. Camera width is 1472.But still stride(plane.fmt.stride showing as 1536). Can we change this stride value? How does Nvbuffer plane.fmt.stride knows the camera stride?
I am getting image as below
may I know which JetPack release version you’re using.
you should be able to add --set-ctrl flags and using preferred_stride options to update the settings.
for example, $ v4l2-ctl -d /dev/video0 ... --set-ctrl preferred_stride=256 ..
thanks
Could you please share your thoughts on how jetson knows and sets the image stride ? I tried with v4l2-ctl command as you suggested . But unfortunately image stride is not getting changed even if camera width is 1472.
Kindly help me
please refer to VI driver to examine these two paragraph for stride settings,
for example, $public_sources/kernel_src/kernel/nvidia/drivers/media/platform/tegra/camera/vi/channel.c
BTW,
you may also enable kernel dynamic debug logs for checking,
for example, # cd /sys/kernel/debug/dynamic_debug/ # echo file channel.c +p > control
then, you should kernel logs ($ dmesg) to print dev_dbg() messages.
thanks
After each block I checked by writing the image data to a file.Image is proper (1472X1088) up to the block(Copying data to Nvbuffer).But image written in the callback handler function is not a proper Image.(I already shared the improper image ) And also as I mentioned previously Nvbuffer plane format stride is 1536.But I am not sure that whether the stride is causing this issue.Kindly share your thoughts
Is there any sample code to refer copying of raw data to NvBuffer using Raw2NvBuffer().I am using read_video_frame() in the sample code (samples/03_video_cuda_enc) to copy the raw data to Nvbuffer plane data in my application.
Thank you for the response.I will check these sample codes.Meanwhile could you please share me your thoughts on how does NvBuffer plane format(stride is getting updated).
I checked NvBufferGetParam() to get pitch, width and height
In my case width = 1456, height =1088 and pitch = 1536.But in our device driver , #define RM_SURFACE_ALIGNMENT is set to 64 (in vi4_fops.c)
I referred the sample codes. I have one doubt in calling the function Raw2NvBuffer().Once it is called how can we feed the data to encoder?