Giter Club home page Giter Club logo

Comments (4)

kyamagu avatar kyamagu commented on July 18, 2024

How reproducible is it? Does it happen to other videos/a camera? Please note that directly calling VideoCapture_() while keeping an instance of cv.VideoCapture in matlab would break its functionality.

from mexopencv.

amroamroamro avatar amroamroamro commented on July 18, 2024

The cv.VideoCapture class is just a wrapper around the MEX-function VidepCapture_, at the same time it uses the MATLAB OOP system to handle the lifetime of the underlying C++ object (delete function is called when object goes out of scope or explicitly cleared).

So if works when calling the MEX-function directly, it should also work for the class wrapper. Try to call cap.isOpened() after you open the video.

Side note: pause is sometimes required if you are opening an actual camera device, I doubt it's needed with a video file stored on disk.

from mexopencv.

gracht23 avatar gracht23 commented on July 18, 2024

I found the problem. I copied all the OpenCV DLL's into the private folder where the MEX files are. This works for most MEX files, only not for the one who dynamically loads the FFMPEG DLL, because this one try's to load the FFMPEG DLL at it's current location and that is of course not the private directory.

The fix was to add some extra lines to my startup script in Matlab:


pathval = getenv('PATH');
opencv_dllpath = fullfile(pwd, '+cv', 'private');
if( isempty(strfind(pathval, opencv_dllpath))
   setenv('PATH', [getenv('PATH') ';'  opencv_dllpath]);
end

from mexopencv.

amroamroamro avatar amroamroamro commented on July 18, 2024

Did you follow the steps in the README file, the bin folder containing the OpenCV DLLs must be put on the system PATH environment variable. That way dynamic loading of libraries works..

If you want to place local copies of the DLLs and skip the PATH, you must do so in both the +cv and the +cv/private folders

from mexopencv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.