How to build FFmpeg (ver 3.1.1) on Android Studio (ver 2.1.2)
<p><strong>I try to build and use FFmpeg Library on Android Studio.</strong></p>
<h2>My Environments</h2>
<p>Windows 7 64bit, Cygwin64, Android Studtio 2.1.2, FFmpeg 3.1.1, Android NDK r12b</p>
<h2>Ref. Page</h2>
<p><a href="http://www.roman10.net/2013/08/18/how-to-build-ffmpeg-with-ndk-r9/" rel="nofollow noreferrer">http://www.roman10.net/2013/08/18/how-to-build-ffmpeg-with-ndk-r9/</a> I follow this page.</p>
<p>I succeed FFmpeg library build using ./build_android.sh on Cygwin</p>
<p>so I try to use FFmpeg Library's on Android Studio.</p>
<h2>Setting Android Studio for use FFmpeg</h2>
<p><strong>my project_path/jni/Android.mk</strong></p>
<pre><code>LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := ffmpeg_trim
LOCAL_SRC_FILES := ffmpeg_trim.c

LOCAL_LDLIBS := -lz -ljnigraphics

LOCAL_SHARED_LIBRARIES := libavformat libavcodec libavutil libswscale libswresample

LOCAL_EXPORT_C_INCLUDES := ($LOCAL_PATH)/include

include $(BUILD_SHARED_LIBRARY)

$(call import-module,ffmpeg-3.1.1/android/arm)
</code></pre>
<p><strong>my jni/Application.mk</strong></p>
<p><code>APP_ABI := armeabi-v7a</code></p>
<p><strong>my project_path/jni/ffmpeg_trim.c</strong></p>
<pre><code>#include &quot;my_package_util_TrimUtil.h&quot;
#include &lt;libavformat/avformat.h&gt;

JNIEXPORT void JNICALL
Java_my_package_videoeditor_util_TrimUtil_registerAll(JNIEnv *env, jobject obj)
{
    av_register_all();
}
</code></pre>
<p><strong>my project_path/jni/ffmpeg_trim.h</strong></p>
<pre><code>/* DO NOT EDIT THIS FILE - it is machine generated */
#include &lt;jni.h&gt;
/* Header for class my_package_videoeditor_util_TrimUtil */

#ifndef _Included_my_package_videoeditor_util_TrimUtil
#define _Included_my_package_videoeditor_util_TrimUtil
#ifdef __cplusplus
extern &quot;C&quot; {
#endif
/*
 * Class:     my_package_videoeditor_util_TrimUtil
 * Method:    registerAll
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_my_package_util_TrimUtil_registerAll
  (JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif
</code></pre>
<p><strong>my project_path/build.gradle</strong></p>
<pre><code>apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion &quot;24.0.0&quot;

    defaultConfig {
        applicationId &quot;my.package.videoeditor&quot;
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName &quot;1.0&quot;
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
        mp4parser {
            applicationIdSuffix &quot;.mp4parser&quot;
        }
        ffmpeg {
            applicationIdSuffix &quot;.ffmpeg&quot;
            ndk {
                moduleName &quot;ffmpeg_trim&quot;
                cFlags &quot;-std=c99 -I${project.buildDir}/../src/ffmpeg/jni/include&quot;
            }

            sourceSets.main {
                jni.srcDirs = []
                jniLibs.srcDir 'src/ffmpeg/libs'
            }
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.googlecode.mp4parser:isoparser:1.1.21'
}
</code></pre>
<p><strong>my project_path/jni folder</strong></p>
<p><a href="https://i.stack.imgur.com/JrMU7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JrMU7.png" alt="enter image description here" /></a></p>
<p>I build my Project.</p>
<p>But, failed and print this message.</p>
<p><a href="https://i.stack.imgur.com/PKjYQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PKjYQ.png" alt="enter image description here" /></a></p>
<p>I can't solve my problem. How to build and use FFmpeg Library on Android Studio.</p>
<p>Don't tell me other libraries using FFmpeg.</p>