Git Product home page Git Product logo

android-opencv-ffmpeg's Introduction

android-opencv-ffmpeg

Android NDK JNI, use opencv compiled with ffmpeg, so you can use videocapture to decode videos, such as mp4,avi and so on.

This project shows you how to use opencv compiled with ffmpeg to read video, include mp4 ,avi and so on. The most important things about how to read video using opencv in android device is compiling opencv with ffmpeg.

My environments: Windows 10, android studio 2.3.3, android sdk 23, ndk 14r, opencv 310, ffmpeg 3.3(latest, 2017/8/20).

Tutorials (3 Steps)

Prepare: Download related source project,including ndk, opencv source(from github), ffmpeg (from github).

Learning step by step.

  1. Compile opencv for android.

There has many tutorials to tell you how to compile both in Windows and Linux.Just google it by youself. ๐ŸŒ

I used this one. Compile opencv310 for android

  1. Import Opencv310 as your module in android project. Test your compiled opencv library

  2. Compile ffmpeg for android.

I offer my uncleaned bash in the project.It can build dynamic libraries for android arch x86 and arm, you can modify for other versions. Put them in ffmpeg source project. Just change its path carefully. Be patient, guys!

  1. Last but not least, opencv with ffmpeg.

You need re-compiling your opencv with ffmpeg. Are you kidding me? I'm not. Seriously, above steps are just preparations, you need cd to your opencv source dir. For offical opencv doesn't support android with ffmpeg, you can just get opencv without ffmpeg from that. First, modify root CMakeLists.txt in opencv source project to let it support android with ffmpeg.Second, modify OpenCVFindLibsVideo.cmake in cmake directory.Samely, for support android with ffmpeg.

Notice: As to how to modify the cmake files, please refer to Issues 2. Wish it can help you.

Finally, recompile your opencv. It supports ffmepg now. Enjoy yourself.

My Test for using opencv with ffmpeg

If videocapture is opened. Then screen gets success info. Otherwise, screen gets the path of the video. After this, you can process your other task just as simple opencv(without ffmpeg) for android.

After All, Libraries you need to get.

Libraries

Success Result Screenshot

Success

About Me


License


MIT License

android-opencv-ffmpeg's People

Contributors

xuchong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.