Environment: ubuntu16.04
Cross Compiler version: 4.8.3
Dependent X264,lame
x264:
1.wget ftp://ftp.videolan.org/pub/x264/snapshots/last_stable_x264.tar.bz2
2.tar XVF last_stable_x264.tar.bz2
3.CD x264-snapshot-20170903-2245-stable
4.export CC=ARM-LINUX-GNUEABI-GCC
5.export Ar=arm-linux-gnueabi-ar
6.mkdir Build
7.CD Build
8 ... /configure--enable-static--enable-shared--disable-asm--prefix= $PWD/__install--host=arm-linux-gnueabi
9.make
10.make Install
Lame
1.wget https://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz
2.tar XVF lame-3.99.5.tar.gz
3.CD lame-3.99.5
4.mkdir Build
5.CD Build
6 ... /configure--prefix= $PWD/__install--host=arm-linux-gnueabi
7.make
8.make Install
Ffmpeg:
1.wget www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
2. Tar xvf ffmpeg-snapshot.tar.bz2
3.CD FFmpeg
4.mkdir Build
5.CD Build
6 ... /configure--cross-prefix=/opt/x86-arm/arm-linux/bin/arm-linux-gnueabi---disable-asm--enable-static--arch=arm-- Target-os=linux--prefix= $PWD/_install--disable-x86asm--ENABLE-GPL--enable-libx264--enable-nonfree-- Enable-cross-compile--extra-cflags=-i/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include-- Extra-ldflags=-l/home/jello/x264-snapshot-20170903-2245-stable/build/_install/lib--EXTRA-LIBS=-LDL
7. Go to step 6 in the current directory with Ffbuild/config.mak, then modify this file
The file has the following changes to be modified everywhere
1.
cflags=-I/HOME/JELLO/X264-SNAPSHOT-20170903-2245-STABLE/BUILD/_INSTALL/INCLUDE-MARCH=ARMV5TE-STD=C11- Fomit-frame-pointer-marm-pthread-g-wdeclaration-after-statement-wall-wdisabled-optimization-wpointer-arith- Wredundant-decls-wwrite-strings-wtype-limits-wundef-wmissing-prototypes-wno-pointer-to-int-cast- Wstrict-prototypes-wempty-body-wno-parentheses-wno-switch-wno-format-zero-length-wno-pointer-sign-o3- Fno-math-errno-fno-signed-zeros-fno-tree-vectorize-werror=format-security-werror=implicit-function-declaration -werror=missing-prototypes-werror=return-type-werror=vla-wformat-wno-maybe-uninitialized
2.
asflags=-i/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include-march=armv5te-g
3.
ldflags=-L/HOME/JELLO/X264-SNAPSHOT-20170903-2245-STABLE/BUILD/_INSTALL/LIB-MARCH=ARMV5TE-WL,--as-needed-wl,-z , Noexecstack-wl,--Warn-common-wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice: Libavformat:libavcodec:libavutil:libavresample
4.extralibs=-lx264-lm-pthread-pthread-lrt-ldl
The above four changes are as follows:
1.
cflags=-i/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include -I/home/jello/lame-3.99.5/ Build/_install/include/lame -march=armv5te-std=c11-fomit-frame-pointer-marm-pthread-g- Wdeclaration-after-statement-wall-wdisabled-optimization-wpointer-arith-wredundant-decls-wwrite-strings- Wtype-limits-wundef-wmissing-prototypes-wno-pointer-to-int-cast-wstrict-prototypes-wempty-body-wno-parentheses -wno-switch-wno-format-zero-length-wno-pointer-sign-o3-fno-math-errno-fno-signed-zeros-fno-tree-vectorize- Werror=format-security-werror=implicit-function-declaration-werror=missing-prototypes-werror=return-type- Werror=vla-wformat-wno-maybe-uninitialized
2.
asflags=-i/home/jello/x264-snapshot-20170903-2245-stable/build/_install/include -I/home/jello/lame-3.99.5/ Build/_install/include/lame -march=armv5te-g
3.
ldflags=-l/home/jello/x264-snapshot-20170903-2245-stable/build/_install/lib-L/home/jello/lame-3.99.5/build /_install/lib -march=armv5te-wl,--as-needed-wl,-z,noexecstack-wl,--warn-common-wl,-rpath-link=libpostproc: Libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
4.EXTRALIBS=-LX264-LM-PTHREAD-PTHREAD-LRT-LDL -lmp3lame
8.make
9.make Install
Cross-compilation Complete!!!
Ubuntu under cross compilation FFmpeg