Ask Your Question
0

Why OpenCV4Android VideoCapture cannot open filename in android

asked 2016-06-11 12:41:48 -0600

binzi gravatar image

updated 2016-06-12 04:48:03 -0600

I am new to Opencv4Android, now I want to use android to open a file from android device by filename, The codes are like below:

VideoCapture cap; cap.open("/mnt/sdcard/DCIM/Camera/demo.mp4");

I found it always be empty, and always read an empty Mat by cap.read(); Does anyone has ever try this, please help ! Thanks !

edit retag flag offensive close merge delete

Comments

Have you resolved this issue?

neutrino gravatar imageneutrino ( 2016-07-25 03:13:33 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-06-12 00:56:46 -0600

berak gravatar image

updated 2016-06-12 00:57:19 -0600

unfortunately, you cannot open video files (or url-streams) on android using VideoCapture.

(there is no backend for this, like ffmpeg or gstreamer)

(opencv3 comes with a builtin mjpg /avi codec.)

edit flag offensive delete link more

Comments

If i add ffmpeg to my project ,can i use this function? Or is there any other way to read video by opencv4android. I find most of solutions are using JavaCV instead.

binzi gravatar imagebinzi ( 2016-06-12 08:07:11 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-11 12:41:48 -0600

Seen: 449 times

Last updated: Jun 12 '16