Ffmpeg porting on android platform

Source: Internet
Author: User


1:
Git clone git: // source.ffmpeg.org/ffmpeg.git ffmpeg
Git checkout 5e99df019a850e9ffa96d73e72b8a47a93a61de8

2:
Export ANDROID_NDK =/home/shilingkai/android_app_dev/android-ndk-r9
Export TOOLCHAIN =/tmp/ffmpeg
Export SYSROOT = $ TOOLCHAIN/sysroot/
$ ANDROID_NDK/build/tools/make-standalone-toolchain.sh -- platform = android-14 -- install-dir = $ TOOLCHAIN

3:
Export PATH = $ TOOLCHAIN/bin: $ PATH
Export CC = arm-linux-androideabi-gcc
Export LD = arm-linux-androideabi-ld
Export AR = arm-linux-androideabi-ar

CFLAGS =-O3-Wall-mthumb-pipe-fpic-fasm
-Finline-limit = 300-ffast-math
-Fstrict-aliasing-Werror = strict-aliasing
-Fmodulo-sched-allow-regmoves
-Wno-psabi-Wa, -- noexecstack
-D1_arm_arch_5 _-d1_arm_arch_5e __
-D1_arm_arch_5t _-d1_arm_arch_5te __
-DANDROID-DNDEBUG

EXTRA_CFLAGS =-march = armv7-a-mfpu = neon-mfloat-abi = softfp-mvectorize-with-neon-quad
EXTRA_LDFLAGS =-Wl, -- fix-cortex-a8

FFMPEG_FLAGS = -- prefix =/tmp/ffmpeg/build
-- Target-OS = linux
-- Arch = arm
-- Enable-cross-compile
-- Cross-prefix = arm-linux-androideabi-
-- Enable-shared
-- Disable-symver
-- Disable-doc
-- Disable-ffplay
-- Disable-ffmpeg
-- Disable-ffprobe
-- Disable-ffserver
-- Disable-avdevice
-- Disable-avfilter
-- Disable-encoders
-- Disable-muxers
-- Disable-filters
-- Disable-devices
-- Disable-everything
-- Enable-protocols
-- Enable-parsers
-- Enable-demuxers
-- Disable-demuxer = sbg
-- Enable-decoders
-- Enable-bsfs
-- Enable-network
-- Enable-swscale
-- Enable-asm
Enable-version3

./Configure $ FFMPEG_FLAGS -- extra-cflags = $ CFLAGS $ EXTRA_CFLAGS -- extra-ldflags = $ EXTRA_LDFLAGS

Make clean
Make-j4
Make install

Rm libavcodec/inverse. o
$ CC-lm-lz-shared -- sysroot = $ SYSROOT-Wl, -- no-undefined-Wl,-z, noexecstack $ EXTRA_LDFLAGS libavutil /*. o libavutil/arm /*. o libavcodec /*. o libavcodec/arm /*. o libavformat /*. o libswresample /*. o libswscale /*. o-o libffmpeg. so

Arm-linux-androideabi-strip -- strip-unneeded libffmpeg. so

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.