Camera v4l2 unable to change resolution

Hi, I tried to change camera resolution via such a command

v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=VYUY

but it doesn’t work. And after that i noticed that camera supports only one resolution

v4l2-ctl --list-formats-ext

ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘GRBG’
Name : 8-bit Bayer GRGR/BGBG
Size: Discrete 2560x1944
Interval: Continuous 0.039s - 1.277s (0.783-25.733 fps)

Index       : 1
Type        : Video Capture
Pixel Format: 'BA10'
Name        : 10-bit Bayer GRGR/BGBG
	Size: Discrete 2560x1944
		Interval: Continuous 0.039s - 1.277s (0.783-25.733 fps)

Index       : 2
Type        : Video Capture
Pixel Format: 'BX24'
Name        : 32-bit XRGB 8-8-8-8
	Size: Discrete 2560x1944
		Interval: Continuous 0.039s - 1.277s (0.783-25.733 fps)

Index       : 3
Type        : Video Capture
Pixel Format: 'XR24'
Name        : 32-bit BGRX 8-8-8-8
	Size: Discrete 2560x1944
		Interval: Continuous 0.039s - 1.277s (0.783-25.733 fps)

Index       : 4
Type        : Video Capture
Pixel Format: 'VYUY'
Name        : VYUY 4:2:2
	Size: Discrete 2560x1944
		Interval: Continuous 0.039s - 1.277s (0.783-25.733 fps)

But there are many different resolutions in the manual for my camera.

What i’m using:

  • Ubuntu 18.04
  • Jetson Nano
  • JetPack 4.6
  • Alvium 1500 C-500m/c

I also have GitHub - alliedvision/linux_nvidia_jetson: Allied Vision CSI-2 camera driver for NVIDIA Jetson Systems. Currently supporting Nano, TX2, AGX Xavier, and Xavier NX. Support for TX2 NX coming soon. installed.

And also i’m wondering how to find out lanes count for CSI camera? Because in manual exposure and gain settings have lanes count in the description of their values but i have possible values that are different from those indicated in manual.

Please, any help is appreciated

Please check the sensor programing guide to know the driver implement and device tree configuration.

Thank you. Do you mean camera guide - Alvium 1500 C-500m/c, or sensor - ON Semiconductor AR0521SR?
And what is programming guide regarding the sensor? i know only user guide for the camera and different manuals for SDK.

The sensor programing guide guide you to implement sensor driver for Jetson devices.

If the sensor only support one resolution then you can’t change the resolution.
You need modify the sensor driver to add more sensor mode or crop the frame by VIC as post process.

Thank you, i will try. But if the camera has some resolutions described and the sensor inside the camera is ON Semiconductor AR0521SR how it can be that sensor doesn’t support those resolutions?

I see in v4l2-ctl --all --device /dev/video0 command output such string

sensor_modes 0x009a2082 (int) : min=0 max=30 step=1 default=30 value=1 flags=read-only

And i read in different forums about changing sensor mode but i can’t do it because it’s read only option,

If v4l2-ctl --list-formats-ext didn’t list what your want that tell the driver didn’t implement that sensor mode.
The sensor_modes was use to select which mode, also the device tree need enable it for mode selected.

Thank you. Output of v4l2-ctl --list-formats-ext is

ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘GRBG’
Name : 8-bit Bayer GRGR/BGBG
Size: Discrete 2592x1944
Interval: Continuous 0.059s - 1.938s (0.516-16.968 fps)

Index       : 1
Type        : Video Capture
Pixel Format: 'BA10'
Name        : 10-bit Bayer GRGR/BGBG
	Size: Discrete 2592x1944
		Interval: Continuous 0.059s - 1.938s (0.516-16.968 fps)

Index       : 2
Type        : Video Capture
Pixel Format: 'BX24'
Name        : 32-bit XRGB 8-8-8-8
	Size: Discrete 2592x1944
		Interval: Continuous 0.059s - 1.938s (0.516-16.968 fps)

Index       : 3
Type        : Video Capture
Pixel Format: 'XR24'
Name        : 32-bit BGRX 8-8-8-8
	Size: Discrete 2592x1944
		Interval: Continuous 0.059s - 1.938s (0.516-16.968 fps)

Index       : 4
Type        : Video Capture
Pixel Format: 'VYUY'
Name        : VYUY 4:2:2
	Size: Discrete 2592x1944
		Interval: Continuous 0.059s - 1.938s (0.516-16.968 fps)

And about drivers. On the camera site there is instruction how to install the driver: GitHub - alliedvision/linux_nvidia_jetson: Allied Vision CSI-2 camera driver for NVIDIA Jetson Systems. Currently supporting Nano, TX2, AGX Xavier, and Xavier NX. Support for TX2 NX coming soon.

I did it as i’ve already said. I can’t understand what i should do (if it is possible of course) to unlock all possible (according to camera user guide) resolutions… Please, could you give me some more explanations what i can try to do?

Please request the device vendor to help to enable more resolution if you don’t have the driver source code.

Thank you. I can only crop frame size on this camera, vendor helped. The problem has been solved.

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