简体   繁体   中英

V4L2 help in camera settings

I would like to change iris,exposure time and iso parameter using v4l2 lib in linux. I have never used sth like that until now.
I found that i have to change this : V4L2_CID_EXPOSURE_AUTO; and i will do that with this part of code:

// open capture
int descriptor = v4l2_open("/dev/video0", O_RDWR);

// manual exposure control
v4l2_control c;
c.id = V4L2_CID_EXPOSURE_AUTO;
c.value = V4L2_EXPOSURE_MANUAL;
if(v4l2_ioctl(descriptor, VIDIOC_S_CTRL, &c) == 0)
    cout << "success";

After I would like to change these three camera parameters : iris, exposure time and iso.

But I cannot find how...

Have a look to v4l2 extended control

After setting V4L2_CID_EXPOSURE_AUTO parameter to V4L2_EXPOSURE_MANUAL as you did, you could use V4L2_CID_EXPOSURE_ABSOLUTE and V4L2_CID_IRIS_ABSOLUTE to control exposure and iris.

To set iso parameter, you need to set V4L2_CID_ISO_SENSITIVITY_AUTO to V4L2_CID_ISO_SENSITIVITY_MANUAL, next V4L2_CID_ISO_SENSITIVITY could be set.

You can look to v4l-utils that provide the command line tool v4l2-ctl to control a v4l2 device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM