Android ffmpeg支持x264的编译脚本
1.编译x264:
下载最新版的x264
ftp://ftp.videolan.org/pub/videolan/x264/snapshots/
1.解压到指定的目录
2.切换当前目录为该目录
3.创建一个shell脚本build_x264.sh,内容如下:
#!/bin/bash
export NDK=/home/android/android-ndk-r14b
export SYSROOT=
N
D
K
/
p
l
a
t
f
o
r
m
s
/
a
n
d
r
o
i
d
−
21
/
a
r
c
h
−
a
r
m
/
e
x
p
o
r
t
T
O
O
L
C
H
A
I
N
=
NDK/platforms/android-21/arch-arm/ export TOOLCHAIN=
NDK/platforms/android−21/arch−arm/exportTOOLCHAIN=NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
function build_one
{
./configure
–prefix=KaTeX parse error: Expected 'EOF', got '\ ' at position 8: PREFIX \̲ ̲--enable-static…TOOLCHAIN/bin/arm-linux-androideabi-
–sysroot=$SYSROOT
–extra-cflags="-Os -fpic KaTeX parse error: Expected 'EOF', got '\ ' at position 14: ADDI_CFLAGS" \̲ ̲--extra-ldflags…ADDI_LDFLAGS"
KaTeX parse error: Expected 'EOF', got '}' at position 27: …CONFIGURE_FLAG }̲ CPU=arm PREFIX…(pwd)/android/$CPU
ADDI_CFLAGS=""
build_one
2.编译ffmpeg:
下载最新版的ffmpeg
http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
1.解压到指定的目录
2.切换当前目录为该目录
3.创建一个shell脚本build_android.sh,内容如下:
#!/bin/bash
export NDK_HOME=/home/android/android-ndk-r14b
function build
{
echo “start build ffmpeg for KaTeX parse error: Expected 'EOF', got '\ ' at position 37: …arget-os=linux \̲ ̲ --prefix=PREFIX --arch=KaTeX parse error: Expected 'EOF', got '\ ' at position 5: CPU \̲ ̲ --disable-doc …CROSS_COMPILE
–enable-cross-compile
–sysroot=$SYSROOT
–enable-small
–enable-protocols
–enable-libx264
–extra-cflags=”-I/home/android/libx264/include"
–extra-ldflags="-L/home/android/libx264/lib"
–extra-cflags="-Os -fpic KaTeX parse error: Expected 'EOF', got '\ ' at position 14: ADDI_CFLAGS" \̲ ̲ --extra-ldflag…ADDI_LDFLAGS"
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
echo “build ffmpeg for $CPU finished”
}
#arm
PLATFORM_VERSION=android-14
ARCH=arm
CPU=armeabi
PREFIX=
(
p
w
d
)
/
a
n
d
r
o
i
d
a
l
l
/
(pwd)/android_all/
(pwd)/androidall/CPU
TOOLCHAIN=
N
D
K
H
O
M
E
/
t
o
o
l
c
h
a
i
n
s
/
a
r
m
−
l
i
n
u
x
−
a
n
d
r
o
i
d
e
a
b
i
−
4.9
/
p
r
e
b
u
i
l
t
/
l
i
n
u
x
−
x
8
6
6
4
C
R
O
S
S
C
O
M
P
I
L
E
=
NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 CROSS_COMPILE=
NDKHOME/toolchains/arm−linux−androideabi−4.9/prebuilt/linux−x8664CROSSCOMPILE=TOOLCHAIN/bin/arm-linux-androideabi-
ADDI_CFLAGS="-marm -mthumb"
ADDI_LDFLAGS=""
SYSROOT=
N
D
K
H
O
M
E
/
p
l
a
t
f
o
r
m
s
/
NDK_HOME/platforms/
NDKHOME/platforms/PLATFORM_VERSION/arch-$ARCH/
build
#arm-v7a
PLATFORM_VERSION=android-14
ARCH=arm
CPU=armeabi-v7a
PREFIX=
(
p
w
d
)
/
a
n
d
r
o
i
d
a
l
l
/
(pwd)/android_all/
(pwd)/androidall/CPU
TOOLCHAIN=
N
D
K
H
O
M
E
/
t
o
o
l
c
h
a
i
n
s
/
a
r
m
−
l
i
n
u
x
−
a
n
d
r
o
i
d
e
a
b
i
−
4.9
/
p
r
e
b
u
i
l
t
/
l
i
n
u
x
−
x
8
6
6
4
C
R
O
S
S
C
O
M
P
I
L
E
=
NDK_HOME/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 CROSS_COMPILE=
NDKHOME/toolchains/arm−linux−androideabi−4.9/prebuilt/linux−x8664CROSSCOMPILE=TOOLCHAIN/bin/arm-linux-androideabi-
ADDI_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -mfpu=neon"
ADDI_LDFLAGS="-march=armv7-a -Wl,–fix-cortex-a8"
SYSROOT=
N
D
K
H
O
M
E
/
p
l
a
t
f
o
r
m
s
/
NDK_HOME/platforms/
NDKHOME/platforms/PLATFORM_VERSION/arch-$ARCH/
build
#x86
PLATFORM_VERSION=android-14
ARCH=x86
CPU=x86
PREFIX=
(
p
w
d
)
/
a
n
d
r
o
i
d
a
l
l
/
(pwd)/android_all/
(pwd)/androidall/CPU
TOOLCHAIN=
N
D
K
H
O
M
E
/
t
o
o
l
c
h
a
i
n
s
/
x
86
−
4.9
/
p
r
e
b
u
i
l
t
/
l
i
n
u
x
−
x
8
6
6
4
C
R
O
S
S
C
O
M
P
I
L
E
=
NDK_HOME/toolchains/x86-4.9/prebuilt/linux-x86_64 CROSS_COMPILE=
NDKHOME/toolchains/x86−4.9/prebuilt/linux−x8664CROSSCOMPILE=TOOLCHAIN/bin/i686-linux-android-
ADDI_CFLAGS="-march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32"
ADDI_LDFLAGS=""
SYSROOT=
N
D
K
H
O
M
E
/
p
l
a
t
f
o
r
m
s
/
NDK_HOME/platforms/
NDKHOME/platforms/PLATFORM_VERSION/arch-$ARCH/
build
#x86_64
PLATFORM_VERSION=android-14
ARCH=x86_64
CPU=x86_64
PREFIX=
(
p
w
d
)
/
a
n
d
r
o
i
d
a
l
l
/
(pwd)/android_all/
(pwd)/androidall/CPU
TOOLCHAIN=
N
D
K
H
O
M
E
/
t
o
o
l
c
h
a
i
n
s
/
x
8
6
6
4
−
4.9
/
p
r
e
b
u
i
l
t
/
l
i
n
u
x
−
x
8
6
6
4
C
R
O
S
S
C
O
M
P
I
L
E
=
NDK_HOME/toolchains/x86_64-4.9/prebuilt/linux-x86_64 CROSS_COMPILE=
NDKHOME/toolchains/x8664−4.9/prebuilt/linux−x8664CROSSCOMPILE=TOOLCHAIN/bin/x86_64-linux-android-
ADDI_CFLAGS="-march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel"
ADDI_LDFLAGS=""
SYSROOT=
N
D
K
H
O
M
E
/
p
l
a
t
f
o
r
m
s
/
NDK_HOME/platforms/
NDKHOME/platforms/PLATFORM_VERSION/arch-$ARCH/
build
相关文章
- Android应用风格不应照抄iOS
- [Android Pro] AsyncTaskLoader vs AsyncTask
- Android实例-Delphi在运行时更改Android屏幕旋转(IOS也支持,不过我可没有苹果机,测试不了)
- Failed to fetch URl https://dl-ssl.google.com/android/repository/addo Android SDK更新以及ADT更新出现问题的解决办法
- 132、Android安全机制(2) Android Permission权限控制机制(转载)
- android 属性动画
- 《Gradle权威指南》--Android Gradle NDK支持
- 可能是目前市面上唯一能够支持全平台的RTMP推流组件:Windows、Linux、Android、iOS、ARM
- EasyPusher进行Android UVC外接摄像头直播推送实现方法
- Android开发学习---使用Intelij idea 13.1 进行android 开发
- 《android开发艺术探索》读书笔记(十)--Android的消息机制
- Android MediaPlayer 实现音乐播放器
- Android 10.0 导航栏增加虚拟按键 点击控制下拉状态栏展开和收缩
- Android Shader渲染器:BitmapShader图片渲染
- 【Android布局】在程序中设置android:gravity 和 android:layout_Gravity属性
- Android学习笔记(四十):Preference的使用
- Lenovo k860i 移植Android 4.4 cm11进度记录【下篇--实时更新中】
- Android 自定义的验证码输入框(无光标),android版本10暂时不支持自定义粘贴
- Android的报错提示:Failed to resolve: com.android.support:appcompat-v7:28.0.0
- Android Studio的报错提示:android.content.res.Resources$NotFoundException: Resource ID #0xfffffe6c
- android Binder系列讲解
- 迁移到Android后android.support.v4.content.FileProvider运行崩溃