Ask Your Question

Revision history [back]

opencv frame count

fr_cnt = cap.get(CV_CAP_PROP_POS_FRAMES);

I'm getting frame number of a video with this code,

and when it gets a certain key, it skips 50 frames

fr_cnt += 50; cap.set(CV_CAP_PROP_POS_FRAMES, fr_cnt-1);

but when the frame is skipped, the number of frame shown on the video is counted slower than the real frame number, and the difference gets bigger as the time goes. What would be the problem here?

opencv frame count

fr_cnt = cap.get(CV_CAP_PROP_POS_FRAMES);

cap.get(CV_CAP_PROP_POS_FRAMES);

I'm getting frame number of a video with this code,

and when it gets a certain key, it skips 50 frames

fr_cnt += 50;
cap.set(CV_CAP_PROP_POS_FRAMES, fr_cnt-1);

fr_cnt-1);

but when the frame is skipped, the number of frame shown on the video is counted slower than the real frame number, and the difference gets bigger as the time goes. What would be the problem here?