#includeusing namespace cv; int main() { VideoCapture cap(0); cap.set(CAP_PROP_FPS, 30); return 0; }
#includeusing namespace cv; int main() { VideoCapture cap(0); cap.set(CAP_PROP_FRAME_WIDTH, 640); cap.set(CAP_PROP_FRAME_HEIGHT, 480); return 0; }
#includeThis code creates a VideoCapture object for the first camera and sets the video format to MJPEG. These examples use the OpenCV library which needs to be installed on the system.using namespace cv; int main() { VideoCapture cap(0); cap.set(CAP_PROP_FOURCC, VideoWriter::fourcc('M', 'J', 'P', 'G')); return 0; }