#include "stdafx.h"
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
//cvNamedWindow("test", CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCreateFileCapture("G://test.avi");//cvcapture 和 vediocapture 区别:一个是c一个是c++
//获取视频总帧数
int numFrames = (int)cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_COUNT);
cout << "视频总帧数为:" << numFrames << endl;
//获取视频fps
int fps = (int)cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
cout << "fps:" << fps << endl;
IplImage* frame;
int pos = 0;
while (1)
{
//抽取帧
cvSetCaptureProperty(capture, CV_CAP_PROP_POS_FRAMES, pos);
cout << pos
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
//cvNamedWindow("test", CV_WINDOW_AUTOSIZE);
CvCapture* capture = cvCreateFileCapture("G://test.avi");//cvcapture 和 vediocapture 区别:一个是c一个是c++
//获取视频总帧数
int numFrames = (int)cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_COUNT);
cout << "视频总帧数为:" << numFrames << endl;
//获取视频fps
int fps = (int)cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
cout << "fps:" << fps << endl;
IplImage* frame;
int pos = 0;
while (1)
{
//抽取帧
cvSetCaptureProperty(capture, CV_CAP_PROP_POS_FRAMES, pos);
cout << pos