1

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;
  }
}
user3411355
  • 13
  • 1
  • 3

1 Answers1

1

I assume that your paths are correct.

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

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.

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

Adi Shavit
  • 16,743
  • 5
  • 67
  • 137