Ask Your Question
0

OpenCv 3.2 Video file not displaying only header displays

asked 2017-06-26 02:02:57 -0600

dougieswim gravatar image

updated 2017-06-26 02:14:30 -0600

berak gravatar image

I am trying to get OpenCv3.2 to open a video file but it only opens the window header. I am using a MacBook pro mid-2015 version and using C++ on Xcode. It is definitely reading it but nothing displays. Any help would be deeply appreciated.

using namespace cv;
using namespace std;

int main(int argc, char** argv){
   cvNamedWindow("xample2", CV_WINDOW_AUTOSIZE);
VideoCapture capture("/filename.mp4");
Mat frame;

if(!capture.isOpened()) {
    cout << "Could not open file" << endl;
    return -1;
}
while(true) {
    capture >> frame;
    if(frame.empty()) break;
    imshow( "xample2", frame );
    char c = cvWaitKey(1000);
    if( c == 27 ) break;
}

}

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-06-26 08:12:08 -0600

I ran into a similar issue as well and this is how I resolved it. Don't forget to up vote if it helps resolve your issue :)

edit flag offensive delete link more

Comments

I can find the CVView but cannot find the CVWindow and CVSlider code... sorry new to all of this. Really appreciate the help, new to OpenCV. Will definitely vote

dougieswim gravatar imagedougieswim ( 2017-06-26 19:42:58 -0600 )edit

That's odd.. You should be able to find them because they are even available in their source code. Open the window_cocoa.mm file and search for @implementation and you should have three instances. If not, then I'd recommend you re-clone the opencv repo

eshirima gravatar imageeshirima ( 2017-06-27 08:23:32 -0600 )edit
0

answered 2017-06-26 02:12:01 -0600

berak gravatar image
edit flag offensive delete link more

Comments

Thank you!

dougieswim gravatar imagedougieswim ( 2017-06-26 04:55:58 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-06-26 02:02:57 -0600

Seen: 226 times

Last updated: Jun 26 '17