Created
September 10, 2015 10:06
-
-
Save TIS-Edgar/e2bd764e5594897d1835 to your computer and use it in GitHub Desktop.
set v4l2 framerate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The values in numerator and denominator should be flipped. This will always result in 1fps, rather than the intended 15fps.