fen1ksss
fen1ksss

Reputation: 1120

Slow video-capturing with opencv 2.3.1

Is there a way to stream video with opencv faster?

i'm using

Mat img;
VideoCapture cap(.../video.avi);
for (;;) {
    cap >> img;
    ...
    here is some calculations
}

Thanks

Upvotes: 1

Views: 1064

Answers (1)

karlphillip
karlphillip

Reputation: 93410

Since the frame grabbing procedure is pretty straightforward, the slowness you are experiencing could caused by some calculations consuming your CPU, decreasing the FPS displayed by your application.

It's hard to tell without looking at the code that does this.

But a simple test to pinpoint the origin of the problem would be to simply remove some calculations and make a simple application that read the frames from the video and displays them. Simple as that! If this test works perfectly, then you know that the performance is being affected by the calculations that are being done.

Good luck.

Upvotes: 1

Related Questions