-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
videoCapture in iOS returns 1 for all properties #6450
Copy link
Copy link
Closed
Description
- OpenCV version: 3.1
- Host OS: Mac OS X 10.11.4
- iOS
In which part of the OpenCV library you got the issue?
opening a file with videoCapture
Expected behaviour
it would open the video, give me access to the video's properties and frames
Actual behaviour
it claims to open the file but all properties return 1 and trying to get frames fails
I found this stack overflow post from 2 years ago that describes the same problem http://stackoverflow.com/questions/22006052/opencv-on-ios-videocapture-properties-always-return-1
Code example to reproduce the issue / Steps to reproduce the issue
Please try to give a full example which will compile as is.
#import <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int Tracking::processFile(string fileIn)
{
VideoCapture cap(fileIn); // open the video file for reading
if ( !cap.isOpened() ) // if not success, exit program
{
cout << "Cannot open the video file: " << fileIn << endl;
return -1;
}
else{
cout << "File Open " << fileIn << endl;
}
double dFps = cap.get(CAP_PROP_FPS); //get the frames per seconds of the video
cout << "Frames per second = " << dFps << endl;
double dWidth = cap.get(CAP_PROP_FRAME_WIDTH); //get the width of frames of the video
double dHeight = cap.get(CAP_PROP_FRAME_HEIGHT); //get the height of frames of the video
cout << "Frame Size = " << dWidth << "x" << dHeight << endl;
Size frameSize(static_cast<int>(dWidth), static_cast<int>(dHeight));
double dFrameCount = cap.get(CAP_PROP_FRAME_COUNT);
cout << "Frame count = " << dFrameCount << endl;
return 0;
}
Reactions are currently unavailable