Ask Your Question

ooznerol's profile - activity

2014-03-19 12:56:57 -0600 commented answer opencv_ffmpeg247_64.dll:-1: error: file not recognized: File format not recognized

Hello are you sure that the problem is solve in latest stable branch? I had download the 248 version and i have the same problem : opencv_ffmpeg248_64.dll:-1: error: file not recognized: File format not recognized thanks

2014-03-19 12:51:53 -0600 commented question Qt+OpenCV file not recognized: File format not recognized

HI

Have you found a solution?

I have exactly the same problem with version 247 and 248 but not on 246. thanks

2014-03-19 07:09:04 -0600 asked a question opencv 247 or 248 open video file failed (but ok with 246)

HI all

I am working with opencv and QT. I am on windows 7 64 bits

Until now I work with opencv 246 and all is working fine. I compile the source with mingw.

I had try to upgrate to opencv 247 and 248 but I can't success to open any video file. I success to open image file (like jpeg) but no video. the cv::VideoCapture open return false. I suspect a problem with opencv_ffmpeg but I had no idea how to debug it. The compilation of the source with mingw is OK. A difference that i have seen between the build of version 246 and build 247/248 is the file opencv_ffmpegXXXXX.dll. For the 246 version , I have a opencv_ffmpeg246.dll and for the the 247/248 opencv_ffmpeg247_64.dll or opencv_ffmpeg248_64.dll.

Can somebody help me? thanks

Here is my code

void SimplePlayer::play()
{
   QString path = ui->lineEdit->text();

   cv::Mat mat;

   if (!path.isEmpty())
   {
       ui->statusBar->showMessage("open : " + path);
       if (path.contains(".jpeg") || path.contains(".jpg"))
       {

           mat = cv::imread(path.toStdString());
           cvNamedWindow("hello");
           cv::imshow("hello",mat);

           cvWaitKey(0);
       }
       if (path.contains(".avi") || path.contains(".h264") || path.contains(".wmv"))
       {
           cv::VideoCapture video;
           video.open(path.toStdString());

           if (!video.isOpened())
           {
               ui->statusBar->showMessage("FAILED open : " + path);
           }
           else
           {
               double capture_width = video.get(CV_CAP_PROP_FRAME_WIDTH);

               double capture_heigh = video.get(CV_CAP_PROP_FRAME_HEIGHT);

               quint64 frame_index = 0;


               while (1)
               {
                   video.read(mat);
                   cvNamedWindow("SimplePlayer",CV_WINDOW_AUTOSIZE);

                   double fps = video.get(CV_CAP_PROP_FPS);
                   QString message;


                  message = "fps="  + QString::number(fps);

                   putText(mat, message.toStdString(), cvPoint(30,30),1.5, 0.5, cvScalar(200,200,250), 1, CV_AA);
                   message = "frame=" + QString::number(frame_index) ;
                   putText(mat, message.toStdString(), cvPoint(30,40),1.5, 0.5, cvScalar(200,200,250), 1, CV_AA);
                   message = "resolution=" + QString::number(capture_width) + "x" + QString::number(capture_heigh);
                   putText(mat, message.toStdString(), cvPoint(30,50),1.5, 0.5, cvScalar(200,200,250), 1, CV_AA);


                   cv::imshow("SimplePlayer",mat);

                   char c = cvWaitKey(33);

                   if(c==27)
                   {

                       break;
                   }
                   frame_index ++;

//               cvWaitKey(0);
               }
               cv::destroyAllWindows();
           }
       }
   }


}