hi sir,
I have a webcam , its fps in 1280x720 is about 10 .
As I know that the fps can reach to 30 fps if I change VideoCapture’s input format to MJPG.
I used following code in opencv450 without gstreamer and It works fine, the fps in 1280x720 could be about 30
int main()
{
VideoCapture video(0);
std::cout << "MJPG: " << video.set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('M', 'J', 'P', 'G'));
video.set(CAP_PROP_FRAME_WIDTH,1280);
video.set(CAP_PROP_FRAME_HEIGHT,720);
cout<<"fps: "<< video.get(CAP_PROP_FPS)<<endl;
Mat frame;
while (video.isOpened()) {
video>>frame;
imshow("frame",frame);
waitKey(1);
}
return 0;
}
Now I updated opencv to latest version (4.5.4) and build WITH_GSTREAMER, and the function
video.set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('M', 'J', 'P', 'G'));
no longer works . it shows the message:
[ WARN:0] global /media/gino/a278e84d-9197-4f4e-8f2a-3a52677ef946/home/gino/opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (1390) setProperty OpenCV | GStreamer warning: GStreamer: unhandled property
is that means gstreamer disable the CAP_PROP_FOURCC setting function? What should I do to make the correct setting?