V4l2 capture has trailing black pixels

Hi everyone,

I have same problem:
I want to capture 1948x1096 RAW12 file, bytes of lines (1948*2) is not a multiple of 64.
So I v4l2-ctl -c preferred_stride=3904
The capture file has trailing black pixels.

How do I implement VIDIOC_CROPCAP VIDIOC_S_CROP to solve trailing black pixels.
And Does resolution become smaller? If I want keep 1948x1096 resolution, does it work?

I would suggest to use nvvidconv to do the crop.

Hi ShaneCCC,
If I do not use crop, how can I solve this problem(the capture file has trailing black pixels)?

Using nvvidconv(VIC) to crop. Like the Gstreamer nvvidconv element.


Hi ShaneCCC,

in folder: jetson_multimedia_api/samples/07_video_convert
file: video_convert_main.cpp

I can’t find bayer RGGB12 convert, it seem like didn’t support bayer format?

Do you use v4l2 instead of Argus?

Hi ShaneCCC,

Yes, I use v4l2 command to capture .raw file.

Suppose if using v4l2 suppose you can handle the frame buffer directly by your v4l APP.

I think it can work…
Because when I capture 2592x1944 RAW12 file, it work well.

Attachment is I capture 1948x1096 RAW12
1948x1096-preferred_stride_0.raw (4.1 MB)
And Then set preferred_stride=3904
1948x1096-preferred_stride_3904.raw (4.1 MB)