Search code examples
linuxvideo-capturev4l2

where is the set interval ioctl in Video4Linux2 API?


I am currently using the V4L2 API to capture video from simple webcams. Everything seems to be working fine except I cannot find were to set the frame interval in the API.

I use the VIDIOC_ENUM_FRAMEINTERVALS ioctl() to get all of the supported frame intervals for a particular pixel format and image size. So the driver is returning many supported intervals.

But which ioctl() do I use to actually set a particular interval?

There is a VIDIOC_SUBDEV_S_FRAME_INTERVAL ioctl() but it is marked as experimental and the documentation says it should only be used for subdevice pads, which I am not using.

So, how do I set a particular frame interval with the V4L2 API?

-Andres


Solution

  • The answer to this similar question might help you.

    As to my experience, not all cameras (drivers) support setting the frame rate. Additionally, there is no guarantee that you will receive as many frames as the camera advertises or as you have requested. Especially in low-light situations the true frame rate may drop drastically because the camera adjusts the exposure time to compensate for the missing light.