lessthanoptimal / BoofAndroidDemo

Demonstration of BoofCV for Android devices
125 stars 42 forks source link

Import videos from Android internal/sd memory #18

Open jackaru opened 4 years ago

jackaru commented 4 years ago

Hi, sorry for the question but I can't figure it out what I'm doing wrong, It's 2 days that I'm looking for examples and trying to import a .mp4 video from sd card path but each time the file can't be found. The path is checked without errors, is it possible to import external videos or I made a big mistake?

Here's the code, but as I said, openVideo returns null, so I can't get the frame number

image

lessthanoptimal commented 4 years ago

Hate to break the bad news but you're trying to use a method designed for Desktop only use on Android. I'll see if I can figure out some way to make it fail in such a way that you know what's going on! What i think is happening is that it can't find a codec to open the file so it returns null.

It's been a few years since I've tried to process video on Android. There's a way you can do it with FFMPEG but there might be better ways to do it now.

On Thu, Apr 30, 2020 at 2:36 PM jackaru notifications@github.com wrote:

Hi, sorry for the question but I can't figure it out what I'm doing wrong, It's 2 days that I'm looking for examples and trying to import a .mp4 video from sd card path but each time the file can't be found. The path is checked without errors, is it possible to import external videos or I made a big mistake?

Here's the code, but as I said, openVideo returns null, so I can't get the frame number

[image: image] https://user-images.githubusercontent.com/21238513/80761429-d704c700-8b3a-11ea-9ab8-b066e42fb2ab.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lessthanoptimal/BoofAndroidDemo/issues/18, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFUOVY2FRROF23NI4K4L7TRPHVN5ANCNFSM4MWVATDQ .

-- "Now, now my good man, this is no time for making enemies." — Voltaire (1694-1778), on his deathbed in response to a priest asking that he renounce Satan.

lessthanoptimal commented 4 years ago

So I was just looking at the FFMPEG used in BoofCV. There's actually a chance you could do a special build and get it to work. You can specify which native architectures you wish to support using a command line argument. native_arch what that will do is attempt to download precompiled libraries from bytedeco.javacpp-presets which has builds of the library for Android. I've never tested though...