Ask Your Question

OpenCv 3.2 Video file not displaying only header displays

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

dougieswim gravatar image

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

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

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

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


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 -0500 )edit

That's odd.. You should be able to find them because they are even available in their source code. Open the 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 -0500 )edit

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

berak gravatar image
edit flag offensive delete link more


Thank you!

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

Question Tools

1 follower


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

Seen: 141 times

Last updated: Jun 26 '17