QPixmap* pixmap;
IplImage *imageVideo;
Mat image;
QImage img;
CvCapture* capture = cvCaptureFromeFIle("E:/home.MP4");
FrameRate = (int)cvGetCaptureProprety(capture,CV_CAP_PROP_FPS);//帧率
TotalFrame = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_COUNT);//帧数
QString num = QString::num(totalFrame);//显示出帧数
ui->lineEdit->setTex(num);
int imgH = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT);
int imgW = (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH);
pixmap = new QPixmap(imgW,imgH);
cvSetCaptureProperty(capture,CV_CAP_PROP_POS_FRAMES,100);//第100帧开始读取
imageVideo = cvQueryFrame(capture);
image = Mat(imageVideo);
cvtColor(image,image,CV_BGR2RGB);
img = QImage((const unsigned char*)image.data,image.cols,image.rows,
QImage::Format_RGB88);
*pixmap = QPixmap::fromImage(img);
ui->label->setPixmap(*pixmap);