OpenCV错误在另一台机器上加载视频文件 [英] OpenCV error loading video file on different machine

查看:66
本文介绍了OpenCV错误在另一台机器上加载视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用wxWidgets和OpenCV 2.4.8开发了一个应用程序.我只是使用VideoCapture从磁盘加载avi文件.该应用程序在其开发的机器上运行良好.但是,当在另一台计算机上运行时,cap.open(fileName)返回false,如下面的代码片段所示.有谁知道这里可能是什么问题?

I have developed an application using wxWidgets and OpenCV 2.4.8. I am simply loading avi files from the disk using VideoCapture. The application works perfectly fine on the machine it is developed on. But when run on a different machine, cap.open(fileName) return false as seen in the code snippet below. Does anyone have an idea what might be the problem here?

bool Data::loadVideoFile(const char *fileName)
{
  VideoCapture cap;
  if ( !cap.open(fileName) )  // if not success, return false
  {
    return false;
  }
  else 
  {
  return true;
  }
}

推荐答案

我认为您的路径正确.

I assume that your paths are correct.

您需要确保所运行的计算机具有正确的编解码器和DLL.

You need to make sure that the machine you are running on has the proper codecs and DLLs.

如果您没有opencv_ffmpeg DLL,则Highgui将退回DirectX或VfW编解码器.如果在这种情况下,您没有正确的编解码器,则打开文件将失败.

If you do not have the opencv_ffmpeg DLLs, then Highgui falls back on DirectX or VfW codecs. If, in that case, you do not have the proper CODECs, then opening the file will fail.

这不同于其他OpenCV DLL,当它们不可访问时,它们会生成丢失的DLL错误.

This is unlike the other OpenCV DLLs which generate a missing DLL error when they are inaccessible.

这篇关于OpenCV错误在另一台机器上加载视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆