Videocapture not work in Opencv 3.0.0 for android

asked 2015-09-01 03:05:47 -0500

lulalehaha gravatar image

updated 2015-09-01 03:06:54 -0500

Hello everyone, I am really a freshman in this area. I try to use the Videocapture Class in Opencv 3.0.0., but it doesn't work. The following is my code. image description
After running on my smart phone, the log prints "123" but no "456". It seems that opening video file failed but the video file do exist. It's so strange!! Please help me if you think of any possibility. Thanks a lot :)

My Android studio version is 1.3. My Opencv4Android SDK version is 3.0.0. And the following is my log.

image description

edit retag flag offensive close merge delete


I am having the same issue. I have tried opening a video file and the camera but nothing seems to work. I am doing async init and trying to open the VideoCapture after the init is done. The file exists and the access to the camera is with Videoio.CV_CAP_ANDROID

Any ideas?


foxaxel gravatar imagefoxaxel ( 2015-09-15 16:48:38 -0500 )edit

I am having the same issue, OpenCV fails to load video from a file.

VideoCapture videoSource = new VideoCapture(filePath);

if (videoSource.isOpened()) {
   Log.i("Opencv", "source initialized");
} else {
   Log.i("Opencv", "source initialization failed");

Always prints out source initialization failed. filePath looks something like this

String filePath = "/storage/emulated/0/DCIM/Camera/VID_20151023_232013.mp4"

Please help!

Sonny gravatar imageSonny ( 2015-10-24 11:09:38 -0500 )edit

I am having the same issue. Have you solve it?

Deliss gravatar imageDeliss ( 2015-11-02 10:54:06 -0500 )edit

I guess the issue here is the lack of FFMpeg in my application. Although I'm not 100% sure about this - I don't think its a good idea to use FFMpeg as it's a license hell. From what I understand FFMpeg is GPL licensed (or atleaset some libraries of it), and not that great to build a commercial application

Sonny gravatar imageSonny ( 2015-11-04 19:43:58 -0500 )edit