loop on frames video in opencv java

asked 2014-01-28 15:33:06 -0600

updated 2020-11-28 08:00:45 -0600

I am trying to loop on frames video in openCV java here is my code

Mat frame = new Mat();
int numOfFrames = 0;
boolean hasNext = true;
while(hasNext){
    hasNext = video.read(frame);
    numOfFrames++;
}

the problem is , it loops forever with no result or error or memory leak ! any help please

edit retag flag offensive close merge delete

Comments

You would like to use the capture function and not the read. Read only reads location of data, then needs to be followed by a imdecode to recover the data. The capture function does it all combined for your.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-01-29 08:13:53 -0600 )edit