How to set the exposure and gain of the camera?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to set the exposure and gain of the camera?

1,241件の閲覧回数
Joshua2
Contributor II

Hi,

I'm using imx8mp-evk,
camera previews the video stream normally, but I don't know what commands to use to control other parameters such as exposure, gain, brightness, contrast, etc.
I tried using "v4l2-ctl" but the prompt failed.

imx8mpevk:~# v4l2-ctl -d 3 -c exposure_absolute=100
unknown control 'exposure_absolute'

Can you share usage examples or documentation?

 

Thanks,

Joshua

0 件の賞賛
返信
6 返答(返信)

1,228件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

did you use ISI or ISP? for V4L2 support, maybe you can refer to the link as below

https://community.nxp.com/t5/i-MX-Processors/v4l2-ctl-no-control-available-no-brightness-no-exposure...

 

0 件の賞賛
返信

1,216件の閲覧回数
Joshua2
Contributor II

Hi joanxie,

    Thank you for your reply, we used the ISP, the access is RAW10 format sensor, the ISP is running normally.
T
he kernel version is: Linux imx8mpevk 6.1.55 g770c5fe2c1d1.

The isp-vvcam is: https://github.com/nxp-imx/isp-vvcam.git, branch: lf-6.1.55_2.2.0,based on this branch, we added the driver for sensor.

 

rootimx8mpevk:~# v4l2-compliance -d 3
v4l2-compliance 1.22.1, 64 bits, 64-bit time_t
 
Compliance test for viv_v4l2_device device /dev/video3:
 
Driver Info:
Driver name      : viv_v4l2_device
Card type        : VIV
Bus info         : platform:viv1
Driver version   : 6.1.55
Capabilities     : 0x84201001
Video Capture
Video Capture Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps      : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name      : vvcam-video
Model            : viv_media
Serial           : 
Bus info         : platform:vvcam-video.0
Media version    : 6.1.55
Hardware revision: 0x00000000 (0)
Driver version   : 6.1.55
Interface Info:
ID               : 0x03000012
Type             : V4L Video
Entity Info:
ID               : 0x00000010 (16)
Name             : viv_v4l21
Function         : V4L2 I/O
Pad 0x01000011   : 0: Sink, Must Connect
  Link 0x0200001f: from remote pad 0x1000015 of entity 'vvcam-dwe.1' (V4L2 I/O): Data, Enabled
 
Required ioctls:
test MC information (see 'Media Driver Info' above): OK
warn: v4l2-compliance.cpp(642): media bus_info 'platform:vvcam-video.0' differs from V4L2 bus_info 'platform:viv1'
test VIDIOC_QUERYCAP: OK
test invalid ioctls: OK
 
Allow for multiple opens:
test second /dev/video3 open: OK
warn: v4l2-compliance.cpp(642): media bus_info 'platform:vvcam-video.0' differs from V4L2 bus_info 'platform:viv1'
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
 
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK (Not Supported)
 
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 1 Audio Inputs: 0 Tuners: 0
 
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
 
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)
 
Control ioctls (Input 0):
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 1 Private Controls: 1
 
Format ioctls (Input 0):
fail: v4l2-test-formats.cpp(263): fmtdesc.description mismatch: was 'Y/UV 4:2:0', expected 'Y/CbCr 4:2:0'
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL
test VIDIOC_G/S_PARM: OK
test VIDIOC_G_FBUF: OK (Not Supported)
fail: v4l2-test-formats.cpp(460): pixelformat 3231564e (NV12) for buftype 1 not reported by ENUM_FMT
test VIDIOC_G_FMT: FAIL
fail: v4l2-test-formats.cpp(460): pixelformat 3231564e (NV12) for buftype 1 not reported by ENUM_FMT
test VIDIOC_TRY_FMT: FAIL
fail: v4l2-test-formats.cpp(452): expected EINVAL, but got 16 when getting format for buftype 1
test VIDIOC_S_FMT: FAIL
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK
test Composing: OK
fail: v4l2-test-formats.cpp(1806): doioctl(node, VIDIOC_S_FMT, &fmt)
fail: v4l2-test-formats.cpp(1954): testBasicScaling(node, fmt)
test Scaling: FAIL
 
Codec ioctls (Input 0):
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
 
Buffer ioctls (Input 0):
fail: v4l2-test-buffers.cpp(573): ret && ret != EINVAL (got 16)
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
fail: v4l2-test-buffers.cpp(783): VIDIOC_EXPBUF is supported, but the V4L2_MEMORY_MMAP support is missing or malfunctioning.
fail: v4l2-test-buffers.cpp(784): VIDIOC_EXPBUF is supported, but the V4L2_MEMORY_MMAP support is missing, probably due to earlier failing format tests.
test VIDIOC_EXPBUF: OK (Not Supported)
test Requests: OK (Not Supported)
 
Total for viv_v4l2_device device /dev/video3: 46, Succeeded: 40, Failed: 6, Warnings: 2

 

Thanks,

Joshua

0 件の賞賛
返信

1,205件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

if you use ISP, try to use vvext tool to set, which is under /opt/imx8-isp/bin, the usage is 

./vvext <video_id> "window name" "param string",  you can use  ./vvext <video_id> to find the prompt window, then choose what you need 

0 件の賞賛
返信

1,203件の閲覧回数
Joshua2
Contributor II

Could you share the document? I don't know how to set it.

0 件の賞賛
返信

1,188件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

this just a simple tool, I send the steps to you before, you can just test firstly, go to /opt/imx8-isp/bin, if your camera is video0, just use  ./vvext 0 0 or ./vvext 0, you should find prompt windows like , you also can use ./vvext --help to get further parameter information

joanxie_0-1743060200875.png

 

0 件の賞賛
返信

1,186件の閲覧回数
Joshua2
Contributor II

Okay, thank you very much!

0 件の賞賛
返信