这是我的代码,它以高fps显示视频。我想在这里使用原始fps,但不知道该怎么做。看一些教程,他们正在使用VideoCapture
,我试图使用它,但这给了我链接器错误undefined reference to 'cv::VideoCapture::VideoCapture(std::string const&)'..
,虽然我链接所有库但错误是相同的。我正在使用Dev-C++ 5.11 (GCC 4.9.2)
,所以任何想法如何在这里使用(CV_CAP_PROP_FPS)
-
#include <windows.h>
#include <opencv/cv.hpp>
#include <opencv/highgui.h>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
double fps=0;
cvNamedWindow( "Movie", CV_WINDOW_NORMAL );
CvCapture* capture = cvCreateFileCapture( "G:\\movie\\Journey.2.The.Mysterious.Island.2012.avi" );
IplImage* frame;
//cv::VideoCapture cap("G:\\movie\\Journey.2.The.Mysterious.Island.2012.avi" ); [giving me error]
//fps=cap.get(CV_CAP_PROP_FPS); [How to use this]
while(1)
{
frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "Movie", frame );
char c = cvWaitKey(27);
if( c == 27 ) break; //esc
}
cvReleaseCapture( &capture );
cvDestroyWindow( "Movie" );
}
Thnx:)
答案 0 :(得分:2)
double fps=cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);