Is OpenCV official Android release free to use in commercial usage?

As title, I download the OpenCV Android release 4.8 ZIP file from official website. My worry is that whether it’s safe to use it commercial usage?

My guess is that it should not contain any other 3rd party patent inside since the official release is open for everyone and it doesn’t even have other way for us to enable/disable NON_FREE content.

The reason why it caught my attention is that, earlier I read some old articles that mentioned that OpenCV’s VideoCapture cannot read MP4 (H264) by default, it only accepts MJPEG in AVI container, developer may need to bring other 3rd party backend in (ex: FFMPEG).

However when I use OpenCV official Android release 4.8, it perfectly read MP4 (H264) without any error. I notice the OpenCV source code, they directly have a file ‘modules/videoio/src/cap_android_mediandk.cpp’ that uses Android NDK API’s (AMedia) to decode video.

If my understanding is right, OpenCV should support reading MP4 (H264) without FFMPEG, cause it uses Android NDK for decoding. Then I don’t need to worry about any NON FREE patent usage, or do I?

Aside from video part, I’m also worried what if the official Android release contain NON FREE patent like SURF, SIFT (probably ok since 2020).


SIFT patent has expired years ago. official builds (except maybe those with contrib packages) contain only free stuff.

what you read about VideoCapture tried to describe that VideoCapture uses “backends”, i.e. dependencies. without any, there’s only avi and mjpeg because that’s built in. system APIs can be backends.

when in doubt, consult a lawyer. we can’t give legal advice.

Thanks for reply :slightly_smiling_face:.

To be clear, I’m just wondering the following things:

When OpenCV officially releases the pre-built library (for Android in this case), does it potentially contain any other method which may use non-free patent? Because I haven’t found any clear statement about what patent risk that developer should be aware of, then we can’t even be sure what “backend” that the OpenCV 4.8 is using with respect to video, then we can’t even ask what patent is risky.

For example, how would we know if OpenCV official Android release internally uses GStreamer/FFMPEG for video capturing, or it actually uses system API like Android NDK for h264 decoding (Specifically, I mean this source code):

So if the OpenCV official Android release really uses this Android NDK system API as backend, then the remaining question will just be “whether Android NDK system APIs uses h264 decode is free or not”.

you can check with getBuildInformation(), see “Video I/O” section. I’d assume that maybe the desktop java package comes with ffmpeg but certainly not the android one. it should only have system APIs enabled in its build.

I don’t have answers to your questions. maybe there are answers. I don’t know them. my not knowing should not be construed as those answers not existing. I am not one who is supposed to know this stuff.

you could browse the issues on OpenCV’s github for any information. that is assuming (I didn’t look) that there’s nothing in the actual documentation.

some third party libraries are included by source in OpenCV’s repo. those probably have a certain kind of license that is sufficiently permissible.

if what you’re looking for doesn’t exist yet, you could try to convince the OpenCV developers to prepare such a legalese document for each release.

personally, I’d deal with lawyers by planting them in the back yard. you might wanna retain one of them to make sure similar approaches are all above board.