cannot use opencv to play video, illegal instruction(core dumped)?

asked 2014-05-18 20:01:27 -0600

updated 2014-05-19 02:35:29 -0600

Hello, everyone! I cannot use opencv to play video, illegal instruction(core dumped) when I test the second program of learning opencv early release edition. trying to play avi video, nothing happens!

the code like this

#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"

using namespace cv;
using namespace std;

int main( int argc, char** argv ) {
    cv::namedWindow( "Example3", cv::WINDOW_AUTOSIZE );
    cv::VideoCapture cap;
    cap.open( string(argv[1]) );
    cv::Mat frame;
    while( 1 ) {
        cap >> frame;
        if( !frame.data ) break;
        // Ran out of film
        cv::imshow( "Example3", frame );
        if( cv::waitKey(33) >= 0 ) break;
        }
        return 0;
}

when I try to play bike.avi, nothing happens! What's the matter?

edit retag flag offensive close merge delete

Comments

I use ubuntu 14.04 LTS, install my opencv from gitHub

bluesky220 gravatar imagebluesky220 ( 2014-05-19 03:14:45 -0600 )edit

My opencv shows pictures normally, but cannot play video(avi & mp4).

bluesky220 gravatar imagebluesky220 ( 2014-05-19 03:15:56 -0600 )edit