opencv播放mkv视频

#include "opencv\highgui.h" 
 
int main() 
{
  cvNamedWindow("生活大爆炸.mkv",CV_WINDOW_AUTOSIZE);
  CvCapture* capture = cvCreateFileCapture("生活大爆炸.mkv");
  IplImage* frame = NULL;
  while (1)
  {
    frame = cvQueryFrame(capture);
    if (!frame)
      break;
    cvShowImage("生活大爆炸.mkv",frame);
    char c = cvWaitKey(33);
    if (c == 27)
      break;
  }
  cvReleaseCapture(&capture);
  cvDestroyWindow("生活大爆炸.mkv");
    return 0; 
}

你可能感兴趣的:(opencv)