【问题标题】:error in Displaying video in opencv在opencv中显示视频错误
【发布时间】:2012-07-30 14:08:19
【问题描述】:
#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");
}

这是我尝试过的代码。每当我按如下方式构建解决方案时,我都会收到警告:

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

即使我跑步,我也看不到视频流!!! 当我按 ESC 键退出时,我有类似的东西

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

请帮帮我。我只是opencv的初学者。 谢谢。

【问题讨论】:

    标签: video opencv frame capture


    【解决方案1】:

    检查您的机器上是否有 opencv_ffmpeg231.dll。如果没有,this 帖子有解决方案。

    【讨论】:

      猜你喜欢
      • 2023-01-31
      • 2017-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多