Question

I have a very simple program for Emgu CV calling:

        Capture mMovie = new Capture("movie.mp4");
        Image<Bgr, byte> img = mMovie.QueryFrame();

The problem is, that I get an exception for MP4 loading.

'System.NullPointerReference' occurs in Emgu.CV.dll, and the application is unable to create capture from movie.mp4 file.

I've read that adding file - opencv_ffmpeg242.dll - into x86 (or x64) folder helps, I've done so and I still get an error. Anyone has experience with this? Why is this happening, when I have the opencv_ffmpeg library there?

Note that video was created using ffmpeg library and I'm able to play it in different players that use ffmpeg.

Was it helpful?

Solution

I had the same problem. For me copying opencv_ffmpeg242.dll solved it, so thanks for that suggestion! If the same doesn't work for you, may I suggest:

  1. Make sure it's the correct bitness.
  2. Make sure it's copied to the necessary folder at runtime (e.g. \bin\debug)
  3. Other DLLs might be necessary too. It's probably a good test just to add all the DLLs.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top