这是我的代码,它显示视频,但在高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" );
}
非常感谢:)
double fps=cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);