Skip to content

Instantly share code, notes, and snippets.

@TIS-Edgar
Created September 10, 2015 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save TIS-Edgar/e2bd764e5594897d1835 to your computer and use it in GitHub Desktop.
Save TIS-Edgar/e2bd764e5594897d1835 to your computer and use it in GitHub Desktop.
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
Copy link

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