I’m working on Jetson Xavier NX with imx219 sensor. My sensor supports 4 modes listed below:
v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'RG10' (10-bit Bayer RGRG/GBGB)
Size: Discrete 3280x2464
Interval: Discrete 0.048s (21.000 fps)
Size: Discrete 3280x1848
Interval: Discrete 0.036s (28.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1640x1232
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)
Problem 1:
When I try to change the current format of my sensor using v4l2, it fails and remains on the default format i.e., 3280x2464 (terminal log below)
v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=RG10
talha@talha-desktop:~/Desktop/gstreamer/gstreamer-custom-plugin/gstreamer-myplugin-10$ v4l2-ctl -d /dev/video0 --get-fmt-video
Format Video Capture:
Width/Height : 3280/2464
Pixel Format : 'RG10' (10-bit Bayer RGRG/GBGB)
Field : None
Bytes per Line : 6560
Size Image : 16163840
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
The set-fmt-video command runs without any error but still the format is not set to the expected format.
And I’m also unable to capture raw bayer image for other dimensions apart from the default 3280x2464. Even when I try to capture the smaller size image, it captures 3280x2464 image
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl=bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=file_from_v4l2_1920x1080.raw
The above command captures a raw file of size 16,163,840 bytes which is equal to 3280 x 2464 x 2 = 16163840 (multiplied by 2 as 10 bit image is stored in 16 bits)
I’ve confirmed with nvargus to see if I’m able to extract 1080p raw image from my sensor and yes I am able to extract it so the sensor does support 1080p format as well as shown by the v4l2 list-formats-ext command.
nvargus_nvraw --lps
nvargus_nvraw version 1.15.0
Number of supported sensor entries 5
Entry Source Mode Uniquename Resolution FR BitDepth Mode
Index Index Index CSI Dyn Type
0 0 0 jakku_rear_RBP194 3280x2464 20 10 10 Bayer
1 0 1 jakku_rear_RBP194 3280x1848 28 10 10 Bayer
2 0 2 jakku_rear_RBP194 1920x1080 29 10 10 Bayer
3 0 3 jakku_rear_RBP194 1640x1232 29 10 10 Bayer
4 0 4 jakku_rear_RBP194 1280x 720 59 10 10 Bayer
talha@talha-desktop:~/Desktop/gstreamer/gstreamer-custom-plugin/gstreamer-myplugin-11/test_isp/in_frames$ nvargus_nvraw --c 0 --mode 2 --file “file_from_nvargus_1920x1080.raw” --format “raw”
nvargus_nvraw version 1.15.0
capture: Total captured frame count 90
±----- Exposure info results -----------+
| Exposure | Exposure Time | Sensor Gain |
| 0 | 0.040000 | 8.64462 |
±---------------------------------------+
writeToFile: files file_from_nvargus_1920x1080.raw and file_from_nvargus_1920x1080.txt are successfully
created
The above 2 commands shows my different sensor modes along with successful 1080p raw image capture whose size is 4,154,880 bytes which is equal to 1920 x 1080 x 2.
Problem 2
I’ve passed the bayer image (file_from_v4l2_1920x1080.raw) through my custom written software ISP code and saved it as png file. I’ve attached it here and you can clearly see image captured from v4l2 is giving me ghosty hallows and it looks like that 2 images placed on top of each other and 1 of them is shifted towards left from the right side:
The images captured from nvargus looks fine after I pass them from my software ISP.
I’ve attached both raw bayer images as well here (as the discussion forum isn’t allowing me to upload .raw files)
Note: file_from_v4l2_1920x1080.raw is actually 3280x2464 size image. Named it 1920x1080 as I was trying to capture that resolution


