Ask Your Question
0

OpenCV VideoCapture Android

asked 2020-03-31 09:38:09 -0600

I am trying to read a video file (MP4) using OpenCV on Android Studio. I have OpenCV 343 installed in my application. I know that the file exists at that filepath because I am able to read and process the file using FFmpeg, MediaExtractor and other libraries but when I do a videoCapture(filepath) and then try to read the captured video frames into a matrix using the read() method, the output is always false and the matrix does not contain any frames.

I'm able to read the video using Python OpenCV libraries and videoCapture works fine there. Could anyone please tell me if there is something I need to ensure to get this to work in AndroidStudio/Java?

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-03-31 09:46:21 -0600

berak gravatar image

sadly, you can't read an mp4 file so easily on android, using the VideoCapture class, there's no decoding backend for anything else than MJPEG in an avi container supplied by default.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-03-31 09:38:09 -0600

Seen: 415 times

Last updated: Mar 31 '20