NDK-R19C编译Android支持的FFMPEG库

下载ffmpeg

下载地址:http://ffmpeg.org/download.html

NDK下载地址: https://developer.android.google.cn/ndk/downloads/index.html

编译好的库可以直接调用:https://download.csdn.net/download/xiaolong1126626497/12234197

系统环境如下:

ubuntu18.04

NDK版本:R19C

FFMPEG版本:4.2.2

 

步骤:

下载源码之后,在linux下解压配置。

configure配置代码如下: 配置的编译器是ARM64位(ARM-V8a) 

扫描二维码关注公众号,回复: 9812177 查看本文章

(自己需要修改自己NDK的路径)

./configure --prefix=$PWD/android/arm64  --toolchain=clang-usan --enable-cross-compile --target-os=android --arch=arm64 --cpu=armv8-a --sysroot=/home/wbyq/work_pc/AndroidPath/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/sysroot --cc=/home/wbyq/work_pc/AndroidPath/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang  --cxx=/home/wbyq/work_pc/AndroidPath/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++ --strip=/home/wbyq/work_pc/AndroidPath/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip --extra-cflags='-fPIE -pie -march=armv8-a -mfloat-abi=softfp -mfpu=vfp -marm' --extra-ldflags='-fPIE -pie' --disable-encoders --disable-decoders --disable-avdevice --disable-static --disable-doc --disable-ffplay --disable-network --disable-doc --disable-symver --disable-ffprobe --enable-neon --enable-shared  --enable-gpl --enable-pic --enable-jni --enable-pthreads --enable-mediacodec --enable-encoder=aac --enable-encoder=gif --enable-encoder=libopenjpeg --enable-encoder=libmp3lame --enable-encoder=libwavpack  --enable-encoder=mpeg4 --enable-encoder=pcm_s16le --enable-encoder=png --enable-encoder=mjpeg --enable-encoder=srt --enable-encoder=subrip --enable-encoder=yuv4 --enable-encoder=text --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=libopenjpeg --enable-decoder=mp3 --enable-decoder=mpeg4_mediacodec --enable-decoder=pcm_s16le --enable-decoder=flac --enable-decoder=flv --enable-decoder=gif --enable-decoder=png --enable-decoder=srt --enable-decoder=xsub --enable-decoder=yuv4 --enable-decoder=vp8_mediacodec --enable-decoder=h264_mediacodec --enable-decoder=hevc_mediacodec --enable-bsf=aac_adtstoasc --enable-bsf=h264_mp4toannexb --enable-bsf=hevc_mp4toannexb --enable-bsf=mpeg4_unpack_bframes

生成的文件如下:

wbyq@wbyq:~/work/rk3399/ffmpeg-4.2.2/android$ tree
.
├── bin
│   └── ffmpeg
├── include
│   ├── libavcodec
│   │   ├── ac3_parser.h
│   │   ├── adts_parser.h
│   │   ├── avcodec.h
│   │   ├── avdct.h
│   │   ├── avfft.h
│   │   ├── d3d11va.h
│   │   ├── dirac.h
│   │   ├── dv_profile.h
│   │   ├── dxva2.h
│   │   ├── jni.h
│   │   ├── mediacodec.h
│   │   ├── qsv.h
│   │   ├── vaapi.h
│   │   ├── vdpau.h
│   │   ├── version.h
│   │   ├── videotoolbox.h
│   │   ├── vorbis_parser.h
│   │   └── xvmc.h
│   ├── libavfilter
│   │   ├── avfilter.h
│   │   ├── buffersink.h
│   │   ├── buffersrc.h
│   │   └── version.h
│   ├── libavformat
│   │   ├── avformat.h
│   │   ├── avio.h
│   │   └── version.h
│   ├── libavutil
│   │   ├── adler32.h
│   │   ├── aes_ctr.h
│   │   ├── aes.h
│   │   ├── attributes.h
│   │   ├── audio_fifo.h
│   │   ├── avassert.h
│   │   ├── avconfig.h
│   │   ├── avstring.h
│   │   ├── avutil.h
│   │   ├── base64.h
│   │   ├── blowfish.h
│   │   ├── bprint.h
│   │   ├── bswap.h
│   │   ├── buffer.h
│   │   ├── camellia.h
│   │   ├── cast5.h
│   │   ├── channel_layout.h
│   │   ├── common.h
│   │   ├── cpu.h
│   │   ├── crc.h
│   │   ├── des.h
│   │   ├── dict.h
│   │   ├── display.h
│   │   ├── downmix_info.h
│   │   ├── encryption_info.h
│   │   ├── error.h
│   │   ├── eval.h
│   │   ├── ffversion.h
│   │   ├── fifo.h
│   │   ├── file.h
│   │   ├── frame.h
│   │   ├── hash.h
│   │   ├── hdr_dynamic_metadata.h
│   │   ├── hmac.h
│   │   ├── hwcontext_cuda.h
│   │   ├── hwcontext_d3d11va.h
│   │   ├── hwcontext_drm.h
│   │   ├── hwcontext_dxva2.h
│   │   ├── hwcontext.h
│   │   ├── hwcontext_mediacodec.h
│   │   ├── hwcontext_qsv.h
│   │   ├── hwcontext_vaapi.h
│   │   ├── hwcontext_vdpau.h
│   │   ├── hwcontext_videotoolbox.h
│   │   ├── imgutils.h
│   │   ├── intfloat.h
│   │   ├── intreadwrite.h
│   │   ├── lfg.h
│   │   ├── log.h
│   │   ├── lzo.h
│   │   ├── macros.h
│   │   ├── mastering_display_metadata.h
│   │   ├── mathematics.h
│   │   ├── md5.h
│   │   ├── mem.h
│   │   ├── motion_vector.h
│   │   ├── murmur3.h
│   │   ├── opt.h
│   │   ├── parseutils.h
│   │   ├── pixdesc.h
│   │   ├── pixelutils.h
│   │   ├── pixfmt.h
│   │   ├── random_seed.h
│   │   ├── rational.h
│   │   ├── rc4.h
│   │   ├── replaygain.h
│   │   ├── ripemd.h
│   │   ├── samplefmt.h
│   │   ├── sha512.h
│   │   ├── sha.h
│   │   ├── spherical.h
│   │   ├── stereo3d.h
│   │   ├── tea.h
│   │   ├── threadmessage.h
│   │   ├── timecode.h
│   │   ├── time.h
│   │   ├── timestamp.h
│   │   ├── tree.h
│   │   ├── twofish.h
│   │   ├── tx.h
│   │   ├── version.h
│   │   └── xtea.h
│   ├── libpostproc
│   │   ├── postprocess.h
│   │   └── version.h
│   ├── libswresample
│   │   ├── swresample.h
│   │   └── version.h
│   └── libswscale
│       ├── swscale.h
│       └── version.h
├── lib
│   ├── libavcodec.so
│   ├── libavfilter.so
│   ├── libavformat.so
│   ├── libavutil.so
│   ├── libpostproc.so
│   ├── libswresample.so
│   ├── libswscale.so
│   └── pkgconfig
│       ├── libavcodec.pc
│       ├── libavfilter.pc
│       ├── libavformat.pc
│       ├── libavutil.pc
│       ├── libpostproc.pc
│       ├── libswresample.pc
│       └── libswscale.pc
└── share
    └── ffmpeg
        ├── examples
        │   ├── avio_dir_cmd.c
        │   ├── avio_reading.c
        │   ├── decode_audio.c
        │   ├── decode_video.c
        │   ├── demuxing_decoding.c
        │   ├── encode_audio.c
        │   ├── encode_video.c
        │   ├── extract_mvs.c
        │   ├── filter_audio.c
        │   ├── filtering_audio.c
        │   ├── filtering_video.c
        │   ├── http_multiclient.c
        │   ├── hw_decode.c
        │   ├── Makefile
        │   ├── metadata.c
        │   ├── muxing.c
        │   ├── qsvdec.c
        │   ├── README
        │   ├── remuxing.c
        │   ├── resampling_audio.c
        │   ├── scaling_video.c
        │   ├── transcode_aac.c
        │   ├── transcoding.c
        │   ├── vaapi_encode.c
        │   └── vaapi_transcode.c
        ├── ffprobe.xsd
        ├── libvpx-1080p50_60.ffpreset
        ├── libvpx-1080p.ffpreset
        ├── libvpx-360p.ffpreset
        ├── libvpx-720p50_60.ffpreset
        └── libvpx-720p.ffpreset

14 directories, 159 files

下面公众号里有全套QT、C、C++基础学习教程:

发布了14 篇原创文章 · 获赞 9 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/xiaolong1126626497/article/details/104730720