cannot get two different frames from the video
Hi to everyone. I am quite new on OpenCV. My goal is getting two frames from the video at any time wanted(like one from 10 msec and the other one is 1000 msec). I write this simple code below.
int main( int argc, char* argv[] )
{
Mat frame1,frame2;
VideoCapture capt("drop.avi");
capt.set(CV_CAP_PROP_POS_MSEC,10);
capt.read(frame1);
capt.set(CV_CAP_PROP_POS_MSEC,1000);
capt.read(frame2); //if I comment out this line, frame1 is ok
namedWindow("w1",CV_WINDOW_AUTOSIZE);
namedWindow("w2",CV_WINDOW_AUTOSIZE);
imshow("w1",frame1);
imshow("w2",frame2);
waitKey(2000);
return 0;
}
Within this code, I get two exactly same frames that belongs to 1000 msec of the video. When I comment out "capt.read(frame2)" line, frame1 is ok(shows the frame at 10msec). I also try set frames but the result is same,unfortunately. By the way, I am using OpenCV 245 on VS2010.Is there anything I miss? Any helps would be appreciated.