when i use OpenCV3.4.0 to grab frame from camera, its parameter is set as follow:
capture.set(CV_CAP_PROP_FOURCC, CV_FOURCC('M', 'J', 'P', 'G'));
capture.set(CV_CAP_PROP_FPS, 100);
capture.set(CV_CAP_PROP_FRAME_WIDTH, 640);
capture.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
it works well, and the fps is 100~200, that is enough for me.
But, when I use OpenCV 4.4.0 to use my yolov4 model, I set the parameter of VideoCapture as follow:
capture.set(CAP_PROP_FPS, 60);
capture.set(CAP_PROP_FRAME_WIDTH, 640);
capture.set(CAP_PROP_FRAME_HEIGHT, 480);
capture.set(CAP_PROP_FOURCC, VideoWriter::fourcc('M', 'J', 'P', 'G'));
it can’t create pipe and can’t get any frame any more. SAD!
if I don’t set any parameter for VideoCapture(just use capture.open(2) and capture>>src ), it can works but its fps is only 5~8
Platform is Ubuntu 20.04, camera is just a common USB camera
how to solve it, or what may cause this problem?