I have looked through the question "why can't i open avi in opencv?" already. But the solution mentioned there can not solve my problem, since there is no "opencv_ffmpeg*.dll" in the opencv for java at all. Even though I copied the "opencv_ffmpeg*.dll" into the folder containing opencv for java or added the path of bin folder which included the "opencv_ffmpeg*.dll" to the environment variable 'PATH', the problem still perplexed me.
The codes which go wrong are as below:
VideoCapture capture;
try{
capture = new VideoCapture("1.avi");
} catch (Exception e){
System.out.println("video not exist!");
return;
}
if (!capture.isOpened()){
System.out.println("fail to open the video!");
return;
}
I always got the "fail to open the video!" prompt. 1.avi is placed properly. Even though I used the absolute path, the problem remained.
Do anyone know how to solve this?