#include "cvutils.hpp"

#include "opencv/cv.h"
#include "opencv/highgui.h"

#include <iostream>
#include <ctime>

using namespace std;


int main(int argc, char *argv[]) {
  //cout << "Hello World" << endl;

  CvCapture *inputVideo = cvCaptureFromFile(argv[1]);

  IplImage* frame = cvQueryFrame(inputVideo);
  //IplImage* bwFrame = allocateImage(frame->width, frame->height, IPL_DEPTH_8U, 1);

  int frameNum = 0;
  time_t seconds;
  time_t t0 = time(NULL);
  while (frame) {
    ::goToFrameNum(capture, frameNum, frameNum+1000);
    seconds = time(NULL)-t0;

    cout << frameNum << " " << seconds << endl;

    frameNum+=1000;
  }

  return 1;
}
