0
#include <cv.h>
#include <highgui.h>

int main(int argc,char** argv[])
{

         cvNamedWindow("video",CV_WINDOW_AUTOSIZE);
     CvCapture* capture = cvCreateFileCapture("Input_1.avi");
     if (!capture)
      {
           std::cout << "!!! cvCreateFileCapture didn't found the file !!!\n";
            return -1; 
           }
    IplImage* frame;


    while(1)
    {
        frame = cvQueryFrame(capture);
        if (!frame)
           break;
        cvShowImage("video",frame);
        char c=cvWaitKey(40);
        if (c==27)
            break;
    }
    cvReleaseCapture(&capture);
    cvDestroyWindow("video");
}

This is the code that i tried. i am getting warnings whenever i build the solution as follows :

  Hello_World.cpp

1>c:\opencv231\include\opencv2\flann\logger.h(66): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'

1>c:\opencv231\include\opencv2\flann\flann.hpp(233): warning C4996: 'cv::flann::Index_<T>': was declared deprecated

1>          c:\opencv231\include\opencv2\flann\flann.hpp(278) : see reference to class template instantiation 'cv::flann::Index_<T>' being compiled

1>  Hello_World.vcxproj -> C:\Users\KARTHICK\Documents\Visual Studio 2010\Projects\Hello_World\Debug\Hello_World.exe

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

even if i run , i cant see the video streaming !!! wen i press the ESC key to exit , i hav something like

loaded , unloaded dlls ,cannot find or open PDB file ,
thread has exited with code 0 ,
Native has exited with code 0 .

Please help me out. I am just a beginner in opencv. Thank you.

UltraInstinct
  • 38,991
  • 11
  • 73
  • 100
Karthik Murugan
  • 1,491
  • 4
  • 19
  • 26

1 Answers1

0

Check if you have opencv_ffmpeg231.dll on your machine. If not, this post has a solution.

Community
  • 1
  • 1
go4sri
  • 1,420
  • 2
  • 15
  • 27