最近在学习ffmpeg框架,网上找了很多资料,对着操作但还是报了很多错误,摸索了很久也没有摸到窍门,但是今天终于成功了,下面把集成过程写一下,以免以后忘记了。
1.创建c++工程
2.添加库文件
将编译后的so文件加入libs文件夹中,将include文件夹加入cpp文件夹下
ffmpeg文件夹如图所示
添加so文件如下图展示
设置ndk:ndk选择r17c,一定要选择合适的ndk,要不然会报错
3.将so文件与工程结合
CMakeLists.txt展示,这里主要是绑定so文件
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.10.2)
# Declares and names the project.
project("ffmpeg_test3")
#include_directories(//libs/include)
set(DIR ../../../../libs)
include_directories(${