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:
- http://stackoverflow.com/questions/8414947/why-cant-i-open-avi-video-in-opencv
- http://answers.opencv.org/question/7041/windows-opencv-videocapture-will-not-open-video-file/ (still no answer)
- http://answers.opencv.org/question/69796/opencv3-videocapture-doesnt-work/ (still no answer)
- 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.