Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Saving frames in a loop doesn't match framerate

$
0
0
Hi, I'm trying to capture some frames using a modified version of a code I found here to read frames from the webcam. My webcam is supposed to be pushing 30fps (measured with outputing (CV_CAP_PROP_FPS)), therefore, this loop would take 1 second, if I understood how webcam methods work, but instead it takes around 5-6 seconds. The original example uses imshow to show the webcam video and it seems to work ok. Am I missing somehting? Should I read the frames in other way? Mat frame; std::list matList; while (matList.size() < 30) { cv_cap >> frame; if( frame.empty() ) break; // end of video stream matList.push_back(frame); // ---> --Here, actually, I want to do something else, but for this question will work...--- if( cv::waitKey(1) == 27) break; // stop capturing by pressing ESC ----> --this doesn't work when I press ESC-- }

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>