Не сложно.
Вот вам маленький примерчик для visual C++
//#include "stdafx.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <iostream>
#pragma comment(lib, "cv.lib")
#pragma comment(lib, "cxcore.lib")
#pragma comment(lib, "highgui.lib")
using namespace std;
int main()
{
const char *out_window = "Video from file";
CvCapture* pCapture = 0;
IplImage* pFrame = 0;
pCapture = cvCaptureFromFile("movie.avi"); // загружаем из файла. видео в данном случае рядом с ехе лежит
if (!pCapture)
{
cout << "ERROR. pCapture is empty" << endl;
return EXIT_FAILURE;
}
cvNamedWindow(out_window, 0);//CV_WINDOW_AUTOSIZE);
// в цикле читаем и отображаем каждый фрейм
while(1)
{
pFrame = cvQueryFrame( pCapture );
if(!pFrame)
{
cout << "ERROR. pFrame is empty" << endl;
return EXIT_FAILURE;
}
cvShowImage(out_window, pFrame);
char c = cvWaitKey(33);
if (c == 27)
break;
}
////////////////////////////////////////////////////////////////////////////////
// освобождаем память
cvReleaseCapture( &pCapture );
cvDestroyWindow(out_window);
return 0;
}