FFMPEG is one of the most popular or powerful media processing library with multiple platform support and it is capable of doing Most of Media processing task.

How to Compile Latest FFMPEG for Android with Latest Android NDK.

Follow These Steps

  1. First create a Github account or if you already have than login
  2. Now fork this Repository ffmpegAndroid
  3. And after that open android.sh file in write mode and make changes as per your requirements
  4. After Configuring android.sh as per your requirement save and commit the file
  5. And now goto Actions Tab and if you see a massage just click on enable workflows
  6. if you see a workflow named Build "FFmpeg for Android" just click on it
  7. After opening the workflow click on Run Workflow and wait Until the Process completes
  8. And After Build process completed you can see an artifact file download it and integrate inside your android studio project with Cmakelist.txt or Android.mk

Also Watch this Video Tutorial:


How to Integrate ffmpeg library into Android studio project?

1. First Compile ffmpeg binaries If you have not already compiled ffmpeg binaries as per above tutorial.

2. Now Create jniLibs folder inside your projects /main folder.

auto
Example \<Your Project Directory>\<Your Project>\src\main\jniLibs

3. Copy and paste your compiled ffmpegAndroid files inside jniLibs folder.

4. And after that add following code in Your cmakeList.txt file.

5. Also Add following code in your Module build.gradle file.

auto
defaultConfig {
        //............//
        ndk.abiFilters  'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
        externalNativeBuild {
            cmake {
                cppFlags "-std=c++17 -fexceptions -frtti"
                arguments "-DANDROID_STL=c++_shared"
            }
        }

    }

6. And now just rebuild your project and start using ffmpeg c++ libraries in your Android Studio Project.