Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

VideoCapture can not open some files

My simple code here:

VideoCapture camera = new VideoCapture("visiontraffic.avi");
    if (!camera.isOpened()) {
        System.out.println("Can not open Camera, try it later.");
    }

can only open that file (visiontraffic.avi) but no other files with avi format or other format. Opening camera works fine with:

VideoCapture camera = new VideoCapture(0);

my whole code and my video example can be downloaded here: https://www.dropbox.com/sh/dshmg0cnoup8wgq/AABKv98sn-5Pm2oHXTNg1leaa?dl=0

please help me I'm confused. Other cases I found was absolutely cannot open any video at all, neither opening camera. And I've seen how to resolve it here:

  1. http://stackoverflow.com/questions/8414947/why-cant-i-open-avi-video-in-opencv
  2. http://answers.opencv.org/question/7041/windows-opencv-videocapture-will-not-open-video-file/ (still no answer)
  3. http://answers.opencv.org/question/69796/opencv3-videocapture-doesnt-work/ (still no answer)
  4. http://answers.opencv.org/question/54816/opencv-axis-camera-mac-cannot-read-movie-file/

Actually I didn't really understand how to installing ffmpeg, recompile opencv with ffmpeg config, etc but I think my problem isn't there. And I've tried to copy ffmpeg.dll from opencv everywhere.

thanks in advance.