V4l2 Fcntl.ioctl Vidioc_s_parm For Setting Fps And Resolution Of Camera Capture
I am trying to set fps and resolution of webcam and capture from it via v4l2 Python. v4l2 Python documentation is limited to ; >>> import v4l2 >>> import fcntl &g
Solution 1:
From the V4L2 side, you need to:
- use the
VIDIOC_G_PARMioctl and check thev4l2_streamparm.parm.capture.capabilitymember to find out whether the driver allowsV4L2_CAP_TIMEPERFRAME. - if so, use the
VIDIOC_ENUM_FRAMEINTERVALSioctl to get the list of possible frame intervals (inverse of framerates), in the form ofv4l2_fractstructures - use these values with the
VIDIOC_S_PARMioctl and fill in thev4l2_streamparm.parm.capture.timeperframemember.
That should allow setting the capture-side frame rate. It's your task to make sure you're reading fast enough not to get frame drops.
Post a Comment for "V4l2 Fcntl.ioctl Vidioc_s_parm For Setting Fps And Resolution Of Camera Capture"