Ffmpeg for a Android (Using Tutorial: "Ffmpeg and Android.Mk")

How to make a videoplayer using FFmpeg on android ndk

This tutorial hasn't been written with Android or Java in mind.

One thing you can do is to do all the FFMPEG stuff in your C code, putting your decoded images in a queue. From Java SurfaceView, from a separate thread, you will then be passing a bitmap to the native code. In the native code you will be filling the pixels of that bitmap from your decoded images using AndroidBitmap_lockPixels and other such stuff.

There is a 'bitmap-plasma' sample in the NDK. Although it is not related to FFMPEG it shows how you can operate on a Bitmap from the native code.

How to use latest FFMPEG in Android Studio project?

There's a very easy solution for this, There's a precompiled library for android, as below https://github.com/WritingMinds/ffmpeg-android-java
Simply include this as a gradle project in your code and add few methods as per their documentation and you are done with FFMPEG commands in android.
This library is not very updated and have some missing features but still its good to use for many simple tasks.



Related Topics



Leave a reply



Submit