Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
set v4l2 framerate
bool set_framerate(int fd)
struct v4l2_streamparm parm;
parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
parm.parm.capture.timeperframe.numerator = 15;
parm.parm.capture.timeperframe.denominator = 1;
int ret = xioctl(fd, VIDIOC_S_PARM, &parm);
if (ret < 0)
{
return false;
}
return true;
}
@mrpossoms

This comment has been minimized.

Show comment Hide comment
@mrpossoms

mrpossoms Sep 8, 2017

The values in numerator and denominator should be flipped. This will always result in 1fps, rather than the intended 15fps.

The values in numerator and denominator should be flipped. This will always result in 1fps, rather than the intended 15fps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment