1 | initial version |
Try
int FPS = (int)cap.get(CAP_PROP_FPS);
if it doesn't work try :
VideoCapture cap(YOUR_CAM_INDEX)
time_t cap_start, cap_end;
Mat frame;
MAX_FRAM_NUM = 100;
time(&start);
for(int n = 0; n < MAX_FRAM_NUM n++){cap >> frame;}
time(&end);
double fps = fps = MAX_FRAM_NUM / difftime (end, start);
2 | No.2 Revision |
Try
int FPS = (int)cap.get(CAP_PROP_FPS);
if it doesn't work try :
VideoCapture cap(YOUR_CAM_INDEX)
time_t cap_start, cap_end;
Mat frame;
MAX_FRAM_NUM = 100;
time(&start);
for(int n = 0; n < MAX_FRAM_NUM n++){cap >> frame;}
time(&end);
double fps = fps = MAX_FRAM_NUM / difftime (end, start);
I also checked code you posted and you're modifying width & height from source before calculating fps.