Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Iterating Through a Video Frame by Frame

Hi Folks, In the code below (for playing a video), how does the capture object "know" how to iterate through the video frame by frame? Usually in a while or for loop we use some sort of incrementing technique such as i++ etc.

I think I have seen this before with stream extraction iterators where they automatically increment to read the contents of a buffer but I am not sure how it works. I tried to view the contents of the Videocapture class but can only find the definition (which includes an overloaded>> function) but can not see how it is implemented.


int main()

{ namedWindow("Video"); VideoCapture cap;"video.avi");

Mat frame;


    imshow("Video", frame);

    if(waitKey(300) >= 0)