2012-08-01 4 views
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"); 
} 

이것은 시도한 코드입니다. 다음과 같이 솔루션을 빌드 할 때마다 경고 메시지가 표시됩니다.opencv에서 비디오 표시에 오류가 발생했습니다.

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 ========== 

실행해도 비디오 스트리밍을 볼 수 있습니다 !!! 총리는 내가 저를 도와주세요

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

같은 근래의 ESC 키를 눌러 종료합니다. 나는 opencv에서 초보자입니다. 감사합니다.

답변

0

컴퓨터에 opencv_ffmpeg231.dll이 있는지 확인하십시오. 그렇지 않은 경우 this 게시물에 해결 방법이 있습니다.

관련 문제