Loading video files using VideoCapture in Android
Hi,
My aim is to load two video files, grabbing the frames from each file and creating a single frame.
I have understood I can use VideoCapture
java class to load files and use Mat
class to work on individual frames.
I have two AVI files stored at /storage/emulated/0/Download/received_files/<file>.avi
. However VideoCapture is unable to open the files.
VideoCapture vc1 = new VideoCapture();
VideoCapture vc2 = new VideoCapture();
if (!vc1.open(video1)) {
Log.e(TAG, "Could not open the video file1");
} else {
Log.i(TAG, "Video1 loaded");
}
if (!vc2.open(video1)) {
Log.e(TAG, "Could not open the video file1");
} else {
Log.i(TAG, "Video2 loaded");
}
It always pronts "Could not open ..." message. I have tested the file paths using File.exists and it returns true. What am I missing here?
I am using OpenCV 3.2.0 for Android and Android lollipop.
My Android setup is done properly and I can view the camera in JavaCameraView.