-
-
Save mrpossoms/133c0833e856d07a41279e0ca69aaf51 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; | |
// 1/15 seconds per frame. Or 15 frames/second | |
parm.parm.capture.timeperframe.numerator = 1; | |
parm.parm.capture.timeperframe.denominator = 15; | |
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